Structured Content 2022: Join our conference to explore fresh perspectives on content and digital experiences →

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...

2 replies
Last updated: Jan 13, 2021

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

Jan 13, 2021, 9:21 AM

Ok, I feel silly now. After I deleted the folders

node_modules
,
dist
and the file
package-lock.json
the install command worked without problems.

Jan 13, 2021, 9:28 AM

Thanks for sharing the solution, Thomas 🙌 Glad you could fix it that way!

Jan 13, 2021, 9:35 AM

Sanity.io: Get the most out of your content

Sanity.io is a platform to build websites and applications. It comes with great APIs that let you treat content like data. Give your team exactly what they need to edit and publish their content with the customizable Sanity Studio. Get real-time collaboration out of the box. Sanity.io comes with a hosted datastore for JSON documents, query languages like GROQ and GraphQL, CDNs, on-demand asset transformations, presentation agnostic rich text, plugins, and much more.

Don't compromise on developer experience. Join thousands of developers and trusted companies and power your content with Sanity.io. Free to get started, pay-as-you-go on all plans.