npm ERR! code E404
This error matches known, documented patterns with reliable solutions.
Quick Fix (Most Common Solution)
- Check package name spelling
- Search npmjs.com for correct package name
Seeing "npm ERR! code E404"? This error can be frustrating, but it's usually fixable. It typically affects your development workflow or system. Below you'll find clear, step-by-step solutions to resolve this issue.
What This Error Means
The requested package does not exist or has been unpublished from the npm registry.
Frequently documented in developer and vendor support forums.
Not affiliated with browser, OS, or device manufacturers.
New here? Learn why exact error messages matter →
Common Causes
- Typo in package name
- Package was unpublished
- Private package without authentication
How to Fix
- Check package name spelling
- Search npmjs.com for correct package name
- Authenticate with npm login for private packages
Last reviewed: March 2026 How we review solutions
Why This Happens
npm returns a 404 status code when the registry server confirms that the requested package does not exist at the URL npm constructed. This is an HTTP-level response, not a file system error—npm successfully connected to the registry, sent a request, and the registry replied "not found." The most common cause is a typo in the package name: npm's public registry has over two million packages, and a single misplaced character (e.g., "react-router-domm" instead of "react-router-dom") will produce a 404. Scoped packages present a different risk: if you reference @myorg/utils but have not authenticated with the private registry that hosts it, npm falls back to the public registry where @myorg/utils does not exist. Unpublished packages are another source—npm allows maintainers to unpublish within 72 hours, and after that the name is reserved but returns 404. Corporate environments that use a registry proxy (Verdaccio, Artifactory, Nexus) may return 404 if the proxy's upstream is misconfigured or the package has not been cached yet. Always start by verifying the exact package name on npmjs.com before investigating registry configuration.
Quick Diagnostic Checklist
- Copy the exact package name from the error and search it on npmjs.com
- Check for typos, especially transposed letters or missing hyphens
- If scoped (@org/pkg), verify you are authenticated: npm whoami --registry=URL
- Inspect .npmrc for registry overrides that might redirect requests
- Try npm view package-name to confirm the package exists on the configured registry
Debugging an E404 with registry inspection
# Error output:
# npm ERR! code E404
# npm ERR! 404 Not Found - GET https://registry.npmjs.org/expres - Not found
# npm ERR! 404 'expres@latest' is not in this registry.
# ^^^^^^ <-- typo: should be "express"
# Step 1: Verify the correct name exists
$ npm view express version
4.21.0 # <-- Package exists, name is "express"
# Step 2: Fix the typo in package.json
# Change: "expres": "^4.21.0"
# To: "express": "^4.21.0"
# Step 3: For private/scoped packages, check auth
$ npm whoami --registry=https://npm.mycompany.com
not logged in # <-- Need to authenticate
$ npm login --registry=https://npm.mycompany.com
# Step 4: Verify .npmrc registry configuration
$ cat .npmrc
@myorg:registry=https://npm.mycompany.com/
# Ensure the scope matches your package name
Edge Cases & Unusual Scenarios
Package unpublished within 72-hour window
npm allows unpublishing packages less than 72 hours old. If you depended on a recently published package that was then unpublished, your lockfile still references it. Pin to an alternative package or wait for the author to republish.
Registry mirror lag
Corporate proxies like Verdaccio or Artifactory cache packages from the public registry. A brand-new package may not appear on the proxy for minutes or hours. Bypass the proxy temporarily or trigger a manual cache refresh.
GitHub Packages registry confusion
GitHub Packages uses a different registry URL (npm.pkg.github.com). If your .npmrc points to GitHub Packages for all packages instead of just scoped ones, public packages will return 404.
Optional follow-up
Some users ask whether saving fixes for recurring errors would be useful when the same issue appears again.
Was this explanation helpful?
Frequently Asked Questions
Can unpublished packages be recovered?
No, once unpublished, the package name is reserved for 24 hours then becomes available.
How do I find alternative packages?
Search npmjs.com or use npms.io to find similar packages.
How do I check if a package was unpublished?
Visit npmjs.com/package/package-name. If the page says "not found" but you know it existed before, it was likely unpublished. Check the npm status blog or GitHub issues for the package.
Why does E404 happen only in CI but not locally?
Your CI environment may use a different registry (corporate proxy, GitHub Actions cache) or a different .npmrc file. Compare the registry URL in CI logs against your local npm config get registry output.
Can I install a package directly from a Git repository instead?
Yes. Use npm install github:user/repo or npm install git+https://github.com/user/repo.git to bypass the registry entirely. This works for public repositories and private ones if you have Git credentials configured.
Related Resources
Also Known As
- npm install error
- npm dependency error
- node package manager error
- npm ERR! message
Common Search Variations
- "npm install not working"
- "npm ERR how to fix"
- "node modules error fix"
- "npm install failed what to do"
- "npm dependency conflict solution"
- "why does npm install fail"
Related Errors
Still Stuck?
Paste a different error message or upload a screenshot to get help instantly.