How to fix npm ERR! code EREGISTRYNOTFOUND npm ERR! Registry not found in npm

npmINTERMEDIATEHIGHUpdated Dec 5, 2025· 117 views

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
  1. Verify your current registry configuration
  2. Check and fix .npmrc file issues
  3. Clear npm cache and retry
  4. Test DNS resolution and network connectivity
npm — error
npm config get registry
npm ERR! code EREGISTRYNOTFOUND
npm 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

  1. Network connectivity issue preventing DNS resolution of the registry hostname
  2. Corporate proxy or firewall blocking access to registry.npmjs.org or your configured registry
  3. Incorrect or typo'd registry URL in .npmrc file or npm config
  4. Private registry misconfigured with wrong scope format or authentication token missing
  5. npm registry server temporarily down or experiencing outages

How to fix "npm ERR! code EREGISTRYNOTFOUND npm ERR! Registry not found"

1Verify your current registry configuration

Check what registry npm is currently pointing to. The default should be https://registry.npmjs.org/:

bash
npm config get registry

If the output shows an incorrect or suspicious URL, you likely found the problem. Reset it to the official npm registry:

bash
npm config set registry https://registry.npmjs.org/
2Check and fix .npmrc file issues

Look for .npmrc files in multiple locations that might have incorrect configurations:

bash
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

3Clear npm cache and retry

Corrupted cache can sometimes cause registry lookup failures. Clear it aggressively:

bash
npm cache clean --force

Then delete your lock file and node_modules, then try installing again:

bash
rm -rf package-lock.json node_modules
npm install
4Test DNS resolution and network connectivity

Verify that your system can resolve the registry hostname:

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

5Configure proxy settings if behind corporate network

If you're behind a corporate proxy, configure npm to use it:

bash
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

If your proxy requires authentication, include credentials in the URL (percent-encode special characters):

bash
npm config set proxy http://username:password@proxy.company.com:8080

Disconnect 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