@sanity/vision installation fails with @codemirror/commands 404 error
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 --force2. Check your npm registry configuration
Make sure you're pointing to the correct npm registry:
npm config get registryIt 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-deps5. Delete and reinstall
If the above doesn't work, try a clean slate:
rm -rf node_modules package-lock.json
npm install6. 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/commandsIf 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 thread10 replies
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.