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.
Fixes npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/create-something
# Search for the package
npm search create-react-app
# Or visit https://www.npmjs.com/search?q=your-package# Search for the packagenpm search create-react-app# Or visit https://www.npmjs.com/search?q=your-packagenpm ERR! code E404npm ERR! 404 Not Found - GET https://registry.npmjs.org/create-something
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 install