The E404 error occurs when npm cannot find a package in the registry. The most common cause is a typo in the package name, but it can also indicate registry configuration issues or private package access problems.
This error indicates npm queried the npm registry for a package and received a 404 HTTP response—the package doesn't exist at that URL. Common scenarios: 1. **Typo in package name**: "creat-react-app" instead of "create-react-app" 2. **Package was renamed or removed**: Old name no longer works 3. **Private/scoped package**: Requires authentication or different registry 4. **Wrong registry configured**: .npmrc pointing to wrong registry The error message shows the exact URL npm tried, which helps identify the issue.
Check exact spelling on npmjs.com:
# Search for the package
npm search create-react-app
# Or visit https://www.npmjs.com/search?q=your-packageCommon typos:
- creat-react-app → create-react-app
- expresss → express
- lodash_ → lodash
Verify your registry is correct:
# Check current registry
npm config get registry
# Should be: https://registry.npmjs.org/
# Reset if wrong
npm config set registry https://registry.npmjs.org/Configure registry for scoped packages:
# Set registry for scope
npm config set @mycompany:registry https://npm.pkg.github.com
# Authenticate
npm login --registry https://npm.pkg.github.comIn .npmrc:
@mycompany:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_TOKENClear npm cache in case of stale data:
npm cache clean --force
npm install package-nameVerify you can reach the registry:
npm ping
# Should respond with registry info
# View package info
npm view expressIf ping fails, check network/firewall/VPN settings.
Tips for avoiding 404 errors:
1. Copy package names from npmjs.com rather than typing from memory
2. Use npm search before installing unfamiliar packages
3. Check package.json of example projects for correct names
4. For scoped packages, ensure @ symbol is included: @babel/core not babel/core
For CI/CD with private packages:
# GitHub Actions
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
npm installnpm ERR! code ENOAUDIT npm ERR! Audit endpoint not supported
How to fix "npm ERR! code ENOAUDIT - Audit endpoint not supported"
npm ERR! code EBADDEVENGINES npm ERR! devEngines.runtime incompatible with current node version
How to fix "npm ERR! code EBADDEVENGINES - devEngines.runtime incompatible with current node version"
npm ERR! code ETOOMANYARGS npm ERR! Too many arguments
How to fix "npm ERR! code ETOOMANYARGS - Too many arguments"
npm ERR! code EINVALIDTAGNAME npm ERR! Invalid tag name: tag names cannot contain spaces
How to fix "npm ERR! code EINVALIDTAGNAME - tag names cannot contain spaces"
npm ERR! code E400 npm ERR! 400 Bad Request
How to fix "npm ERR! code E400 - 400 Bad Request" error