How to fix npm ERR! code EREGISTRYNOTFOUND npm ERR! Registry not found in npm
The EREGISTRYNOTFOUND error occurs when npm cannot locate or connect to the configured package registry. This is typically caused by network connectivity issues, misconfigured registry URLs, or proxy settings blocking access.
Quick fix
Fixes npm ERR! code EREGISTRYNOTFOUND npm ERR! Registry not found
npm config get registry- Verify your current registry configuration
- Check and fix .npmrc file issues
- Clear npm cache and retry
- Test DNS resolution and network connectivity
npm config get registrynpm ERR! code EREGISTRYNOTFOUNDnpm ERR! Registry not found
What this error means
This error indicates that npm failed to find the registry server specified in your configuration. When npm tries to fetch a package, it looks for the registry at the configured URL (by default https://registry.npmjs.org). If npm cannot resolve the hostname, reach the server, or the URL is incorrect, it throws EREGISTRYNOTFOUND. This can happen during 'npm install', 'npm publish', or other package operations. The root cause is almost always network-related—either your DNS cannot resolve the registry hostname, a proxy/firewall is blocking the connection, or the registry URL in your configuration is misconfigured.
Typical symptoms
- npm install fails with 'code EREGISTRYNOTFOUND' and cannot fetch any packages
- Intermittent failures that work sometimes but fail other times, suggesting network instability
- npm commands hang for a long time before showing the EREGISTRYNOTFOUND error
- Error appears only when behind a corporate VPN, proxy, or firewall
- Private registry packages fail to install while public packages work fine
Common causes
- Network connectivity issue preventing DNS resolution of the registry hostname
- Corporate proxy or firewall blocking access to registry.npmjs.org or your configured registry
- Incorrect or typo'd registry URL in .npmrc file or npm config
- Private registry misconfigured with wrong scope format or authentication token missing
- npm registry server temporarily down or experiencing outages
How to fix "npm ERR! code EREGISTRYNOTFOUND npm ERR! Registry not found"
Check what registry npm is currently pointing to. The default should be https://registry.npmjs.org/:
npm config get registryIf the output shows an incorrect or suspicious URL, you likely found the problem. Reset it to the official npm registry:
npm config set registry https://registry.npmjs.org/Look for .npmrc files in multiple locations that might have incorrect configurations:
cat ~/.npmrc
cat .npmrc
cat $(npm config get globalconfig)Look for typos or incorrect registry URLs. Common mistakes include:
- https://registry.npmjs.com (should be .org, not .com)
- Incorrect private registry URLs with missing protocol or domain
- Malformed scoped registry entries
Corrupted cache can sometimes cause registry lookup failures. Clear it aggressively:
npm cache clean --forceThen delete your lock file and node_modules, then try installing again:
rm -rf package-lock.json node_modules
npm installVerify that your system can resolve the registry hostname:
ping registry.npmjs.org
nslookup registry.npmjs.org
curl -v https://registry.npmjs.org/If DNS fails, try switching to Google's public DNS (8.8.8.8). On Linux/macOS, edit /etc/resolv.conf. On Windows, use Network Settings to change DNS.
If you're behind a corporate proxy, configure npm to use it:
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080If your proxy requires authentication, include credentials in the URL (percent-encode special characters):
npm config set proxy http://username:password@proxy.company.com:8080Disconnect from any corporate VPN temporarily and try installing—if it works, the issue is proxy/VPN related.
Advanced notes
For private registries (Verdaccio, Nexus, Artifactory, GitLab, etc.), the registry server must be running and accessible. If using scoped packages with private registries, ensure the scope in your package.json matches your .npmrc scope configuration. For example, if your package is @myorg/my-package, your .npmrc must have @myorg:registry=... configured. On Windows WSL, restarting the WSL terminal can resolve transient network issues. If all else fails, try the alternative Yarn registry: npm install --registry https://registry.yarnpkg.com to isolate whether the issue is npm-specific or registry-wide.
Frequently asked questions
- What does "npm ERR! code EREGISTRYNOTFOUND npm ERR! Registry not found" mean?
- This error indicates that npm failed to find the registry server specified in your configuration. org). If npm cannot resolve the hostname, reach the server, or the URL is incorrect, it throws EREGISTRYNOTFOUND.
- How do I fix "npm ERR! code EREGISTRYNOTFOUND npm ERR! Registry not found"?
- The EREGISTRYNOTFOUND error occurs when npm cannot locate or connect to the configured package registry. This is typically caused by network connectivity issues, misconfigured registry URLs, or proxy settings blocking access.
- What causes "npm ERR! code EREGISTRYNOTFOUND npm ERR! Registry not found"?
- Network connectivity issue preventing DNS resolution of the registry hostname Corporate proxy or firewall blocking access to registry.npmjs.org or your configured registry Incorrect or typo'd registry URL in .npmrc file or npm config
- Is the "npm ERR! code EREGISTRYNOTFOUND npm ERR! Registry not found" error serious?
- Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.
Official resources & further reading
- 📚npm Official Documentation
- 💬SO: Registry 404 error(Stack Overflow)
- 📖npm Docs: Common errors(Official Docs)
- 📝