Error when running `sanity deploy` after upgrading project versions
8 replies
Last updated: Jun 17, 2024
J
Hey everyone! I just upgraded a project of mine from v2 and v3 and everything is working locally and the build is previewing locally as well. However, when I run
Even though there is a
Anyone else hit this when upgrading? I also am getting a message in the terminal that I installed the nodes on the intel chip versus my m1 even though I've deleted my
sanity deploy, i'm getting the following error:
Error: sanity.cli.js does not contain a project identifier ("api.projectId"), which is required for the Sanity CLI to communicate with the Sanity API
sanity.cli.jsin the root of the directory that looks like this:
import { defineCliConfig } from "sanity/cli" export default defineCliConfig({ api: { projectId: "my_project_id", dataset: "production", }, })
node_modulesand re-run
npm i. Don't know if they are connected. Thanks in advance for and help!
Apr 1, 2024, 4:56 PM
J
Hey Geoff! Thanks for the response. I'm using 3.11.5
Apr 1, 2024, 5:04 PM
Could you please try running
npx sanity deploy, which will ask to download and then use the latest version (without impacting the version you have installed)?
Apr 1, 2024, 5:08 PM
J
That seemed to do the trick, but did not ask to download anything. Thank you for your help!
Apr 1, 2024, 5:10 PM
Great! In that case, it’s possible there was a change in there somewhere, and upgrading your global install of the CLI (
npm i -g @sanity/cli) should let you run
sanity deploywithout getting that error.
Apr 1, 2024, 5:12 PM
J
Thanks Geoff! Have a great day
Apr 1, 2024, 5:13 PM
T
Hey
I'm using
sanity.cli.js file looks like this:
And
Do you have any other ideas of how to debug this?
Thanks :)
user A
I'm experiencing this error at the moment.I'm using
@sanity/cli version 3.16.7
sanity.cli.js file looks like this:
/* eslint-disable no-process-env */ import { projectId, dataset } from './sanity.config.js' import {defineCliConfig} from '/sanity/cli' export default defineCliConfig({api: {projectId, dataset}})
npx sanity deployisn't quite doing the trick:
Error: sanity.cli.js does not contain a project identifier ("api.projectId"), which is required for the Sanity CLI to communicate with the Sanity API
Do you have any other ideas of how to debug this?
Thanks :)
Jun 17, 2024, 3:26 AM
Sanity– build remarkable experiences at scale
Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.