The ENOREGISTRY error occurs when npm cannot find or access a configured package registry. This typically happens when the registry configuration is missing, misconfigured, or inaccessible due to network issues or missing authentication.
Fixes ENOREGISTRY
npm config get registrynpm config get registrynpm ERR! code ENOREGISTRYnpm ERR! No registry specified
On this page
npm requires a registry URL to download packages. This error appears when npm's configuration lacks a valid registry setting or cannot reach the specified registry server. The registry is the central repository where npm packages are stored and retrieved from.
Run this command to see what registry npm is currently configured to use:
npm config get registryIf the output is empty or shows an invalid URL, your registry is not properly set.
Set npm to use the official public registry:
npm config set registry https://registry.npmjs.org/Verify it was set correctly:
npm config get registry
# Should output: https://registry.npmjs.org/Locate your .npmrc files at ~/.npmrc (global) or in your project root.
Ensure it contains a valid registry line:
registry=https://registry.npmjs.org/On Windows, verify the file encoding is UTF-8, not UCS-2 LE BOM.
Clear any corrupted cache files:
npm cache clean --force
rm -rf node_modules package-lock.json
npm installEnsure you can reach the registry server:
curl https://registry.npmjs.org/If behind a proxy, configure npm to use it:
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080The ENOREGISTRY error is relatively rare in modern npm (v6+) because npm defaults to the public registry if no configuration is found. This error typically appears in fresh installations, Docker containers, or CI/CD environments where the .npmrc file is missing or incorrectly configured. For monorepos using pnpm or yarn, check their respective configuration files.