๐Ÿ—“๏ธ Everything *[NYC] is back. A free gathering for AI builders. Sept 9 โ†’

Sanity CLI "Command failed" error during `sanity install` dependency resolution

2 repliesLast updated: Dec 2, 2025

Does anyone get this error? I have had this problem for a while now and Iโ€™m not sure how to resolve it:


โ•ฐโ”€ sudo npm install -g @sanity/cli
Password:
  /usr/local/bin/sanity -> /usr/local/lib/node_modules/@sanity/cli/bin/sanity
+ @sanity/cli@2.1.4
updated 1 package in 0.774s


โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚                                                                 โ”‚
โ”‚      New patch version of npm available! 6.14.8 โ†’ 6.14.11       โ”‚
โ”‚   Changelog: <https://github.com/npm/cli/releases/tag/v6.14.11>   โ”‚
โ”‚                Run npm install -g npm to update!                โ”‚
โ”‚                                                                 โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

โ•ญโ”€ (anaconda3) ๎‚ฑ ~/dev/&lt;removed&gt;/cms ๎‚ฐ ๎‚  master โ— โŸ4 ๎‚ฐ                                                                          ๎‚ฒ โœ” ๎‚ฒ 4788 ๎‚ฒ 10:16:08
โ•ฐโ”€ sanity upgrade
@sanity/core not installed in current project
Project-specific commands not available until you run `sanity install`
โ ™ Resolving dependencies^C
โ•ญโ”€ (anaconda3) ๎‚ฑ ~/dev/&lt;removed&gt;/cms ๎‚ฐ ๎‚  master โ— โŸ4 ๎‚ฐ                                                                ๎‚ฒ SIGINT(2) โ†ต ๎‚ฒ 4789 ๎‚ฒ 10:16:25
โ•ฐโ”€ sanity install

โœ” Saved lockfile
โœ– Resolving dependencies
โœ– Command failed with exit code 1.
โœ– Resolving dependencies

Error: Command failed :(
  at /usr/local/lib/node_modules/@sanity/cli/bin/sanity-cli.js:3260:2554

AI Update

I've seen this issue before! You're running @sanity/cli@2.1.4, which is Sanity v2 - a significantly older version. The error during sanity install suggests dependency resolution problems, which can happen with older Sanity versions when combined with modern Node.js/npm versions or environment conflicts.

Immediate troubleshooting steps:

The bigger picture - consider upgrading:

Since you're on v2 (from 2020-2021 era), you're likely hitting compatibility issues because the npm ecosystem has evolved significantly. Old dependency trees can fail to resolve with modern package managers and Node versions.

I'd strongly recommend upgrading to Sanity Studio v4. While it requires Node.js 20+, you'll get:

If you need to stay on v2 temporarily:

Try checking if there's a specific package causing the failure by looking at your package.json dependencies. You might also try using an older Node.js version via nvm to match what v2 was originally built against - typically Node 12-16 era.

What Node.js version are you running? That info would help narrow down the issue further. Also, the Anaconda environment is my top suspect here - try deactivating it first before other troubleshooting.

Show original thread
2 replies

Was this answer helpful?

Sanity โ€“ Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions