How to fix npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/package-name in npm

npmBEGINNERMEDIUMUpdated Dec 6, 2025ยท 201 views

This error occurs when npm cannot find a package in the registry. Common causes include typos in the package name, incorrect registry configuration, or trying to access private/scoped packages without authentication.

Quick fix

Fixes E404

npm search package-name
  1. Verify the package name is spelled correctly
  2. Check your registry configuration
  3. Clear npm cache
  4. Handle scoped/private packages
npm โ€” error
npm search package-name
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/package-name

What this error means

The E404 error in npm indicates that the npm registry returned a 404 HTTP status code, meaning the requested package could not be found at the specified URL. This is one of the most common npm errors developers encounter. When you run `npm install package-name`, npm sends a GET request to the registry (by default https://registry.npmjs.org/) to fetch the package metadata. If the registry responds with 404 Not Found, npm reports this error with the exact URL it tried to access. This error can occur for several reasons: the package name is misspelled, the package has been unpublished, you're using a corporate proxy that doesn't have the package, or you're trying to install a scoped package (like `@organization/package`) without proper authentication. Understanding the URL in the error message is key to diagnosing the issue.

Typical symptoms

  • npm install fails with 'npm ERR! code E404' and '404 Not Found'
  • The error message shows the full registry URL that returned 404
  • Error appears for specific packages but others install fine
  • CI/CD pipelines fail during dependency installation
  • Error occurs after switching networks or using VPN

Common causes

  1. Typo in the package name (most common) - e.g., 'lodahs' instead of 'lodash'
  2. Package has been unpublished or deprecated from the npm registry
  3. Incorrect registry URL configured in .npmrc or npm config
  4. Corporate proxy or VPN blocking access to the npm registry
  5. Trying to install a private/scoped package without authentication
  6. Local .npmrc file overriding the global registry configuration
  7. Stale npm cache containing outdated package references

How to fix "npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/package-name"

1Verify the package name is spelled correctly

First, confirm the package exists on npm by searching for it:

bash
npm search package-name

Or visit https://www.npmjs.com/package/package-name in your browser.

Common typos to check:
- Transposed letters: lodash vs lodash
- Missing hyphens: createreactapp vs create-react-app
- Wrong scope: @angular/cli vs angular-cli

If you're using npx, check the command too:

bash
# Wrong
npx crate-react-app my-app

# Correct
npx create-react-app my-app
2Check your registry configuration

Verify which registry npm is using:

bash
npm config get registry

The default should be https://registry.npmjs.org/. If it shows a different URL (like a corporate proxy), that may be the issue.

Reset to the default registry:

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

Also check for local .npmrc files that might override this:

bash
# Check project directory
cat .npmrc

# Check home directory
cat ~/.npmrc
3Clear npm cache

A corrupted or stale cache can cause 404 errors. Clear it with:

bash
npm cache clean --force

Then verify the cache is clean:

bash
npm cache verify

After clearing the cache, try the install again:

bash
npm install
4Handle scoped/private packages

If the error is for a scoped package (starting with @), you may need to authenticate.

For npm private packages:

bash
npm login

For GitHub Packages:

Create a .npmrc file with:

bash
@OWNER:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_TOKEN

For organization packages:

Ensure you have access to the organization and are logged in:

bash
npm whoami
npm org ls your-org
5Check network connectivity

Network issues can cause 404 errors. Test your connection:

bash
# Test direct access to npm registry
curl -I https://registry.npmjs.org/

# Test a specific package
curl https://registry.npmjs.org/lodash

If you're behind a corporate proxy or VPN:

1. Try disconnecting from VPN temporarily
2. Configure npm to use your proxy:

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

Or use HTTP instead of HTTPS (less secure, for troubleshooting only):

bash
npm config set registry http://registry.npmjs.org/
6Update npm to the latest version

An outdated npm version can sometimes cause registry issues:

bash
npm install -g npm@latest

Or if using Node.js with nvm:

bash
nvm install-latest-npm

Verify the update:

bash
npm --version

Advanced notes

### Debugging Registry Requests

To see exactly what npm is doing, use the verbose flag:

bash
npm install package-name --verbose

This shows the full HTTP request/response cycle, helping identify where the 404 originates.

### Corporate Registry/Proxy Issues

Many organizations use npm Enterprise, Artifactory, or Verdaccio as private registries. These proxies cache public packages but may not support:

- Newer packages (not yet cached)
- Scoped packages (requires configuration)
- Organization features

Work with your IT team to ensure the proxy is properly configured to forward requests to the public registry.

### Package Unpublishing

npm allows unpublishing packages within 72 hours of publishing. After that, packages cannot be easily unpublished. If you're seeing 404 for a package that previously existed:

1. Check if it was renamed (common with acquisitions)
2. Look for a deprecation notice on npmjs.com
3. Search for alternatives using npm search

### CI/CD Specific Issues

In CI/CD environments, 404 errors often occur due to:

1. Race conditions: Installing a package that was just published but not yet propagated
2. Token expiration: npm tokens have limited lifetimes
3. Network restrictions: CI runners may not have access to all registries

For CI, consider:
- Using npm ci instead of npm install for reproducible builds
- Caching node_modules between builds
- Setting up a local registry mirror

### Package-lock.json Conflicts

If your package-lock.json references a version that no longer exists:

bash
# Remove lock file and node_modules
rm -rf node_modules package-lock.json

# Fresh install
npm install

This regenerates the lock file with currently available versions.

Frequently asked questions

What does "E404" mean?
The E404 error in npm indicates that the npm registry returned a 404 HTTP status code, meaning the requested package could not be found at the specified URL. This is one of the most common npm errors developers encounter. org/) to fetch the package metadata.
How do I fix "E404"?
This error occurs when npm cannot find a package in the registry. Common causes include typos in the package name, incorrect registry configuration, or trying to access private/scoped packages without authentication.
What causes "E404"?
Typo in the package name (most common) - e.g., 'lodahs' instead of 'lodash' Package has been unpublished or deprecated from the npm registry Incorrect registry URL configured in .npmrc or npm config
Is the "E404" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading