@sanity/vision installation fails with @codemirror/commands 404 error

10 replies
Last updated: Jul 14, 2023
Hey, I am having issues installing
@sanity/vision
. I get the following error. I am using NPM and have also tried yarn.
npm ERR! code E404
npm ERR! 404 Not Found - GET <https://registry.npmjs.org/@codemirror%2fcommands> - Not found
npm ERR! 404
npm ERR! 404  '@codemirror/commands@^6.0.1' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
Any help is greatly appreciated, thanks
AI Update

The 404 error you're seeing with @codemirror/commands when installing @sanity/vision is typically caused by npm registry configuration issues, not a problem with the package itself. The @codemirror/commands package definitely exists on npm, so this points to a connectivity or registry configuration problem on your end.

Here are the steps to resolve this:

1. Clear your npm cache

npm cache clean --force

2. Check your npm registry configuration

Make sure you're pointing to the correct npm registry:

npm config get registry

It should return https://registry.npmjs.org/. If it doesn't, set it explicitly:

npm config set registry https://registry.npmjs.org/

3. Check for a .npmrc file

Look for a .npmrc file in your project root or home directory that might have incorrect registry settings. If you find one with a custom registry that's blocking access to public packages, you may need to adjust it or temporarily remove it.

4. Try installing with legacy peer deps

Sometimes dependency resolution issues can cause this:

npm install @sanity/vision --legacy-peer-deps

5. Delete and reinstall

If the above doesn't work, try a clean slate:

rm -rf node_modules package-lock.json
npm install

6. Network/firewall issues

If you're behind a corporate firewall or VPN, it might be blocking access to the npm registry. Try:

  • Temporarily disabling your VPN
  • Checking if your company has a proxy that needs to be configured
  • Testing on a different network

7. Verify npm is working

Test if you can install the package directly:

npm install @codemirror/commands

If this fails with the same error, it confirms it's an npm configuration issue, not specific to @sanity/vision.

The most common fix is clearing the cache and ensuring your registry is set correctly (steps 1 and 2). This resolves the issue in the majority of cases where the npm registry can't find packages that definitely exist.

Show original thread
10 replies
Maybe npm registries are having issues, I just ran into a very similar issue recently: https://github.com/streetsidesoftware/cspell-dicts/issues/2331
So we just wait for it to be resolved?
Sorry, I just haven't come across this before
neither have i. i have no clue what's happening, my issue just looked exactly like yours
Oof
A second ago, https://registry.npmjs.org/@codemirror%2fcommands was 404ing. Now it's not. idk what changed
Well then... guess we just wait it out. Thanks sharing the link for the status page, forgot those exist
yeah me too. try installing again, mine just started working again
Nice, just worked

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.

Was this answer helpful?