npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/some-package
npm ERR! 404 'some-package@latest' is not in this registry.
npm can’t find the package you’re trying to install.
Fix 1: Typo in Package Name
The #1 cause. Check the spelling.
# ❌ Common typos
npm install expresss # Extra 's'
npm install lodash.merge # Should be lodash.merge or lodash
npm install react-router # Might need react-router-dom
# ✅ Search for the correct name
npm search express
Or check on npmjs.com directly.
Fix 2: Package Was Unpublished or Renamed
Some packages get renamed or removed.
# Check if it exists
npm view some-package
# Common renames
# @babel/core (was babel-core)
# webpack-cli (was webpack-command)
Fix 3: Scoped Package Without Access
npm ERR! 404 '@company/private-pkg' is not in this registry
The package is scoped (@org/name) and either:
- It’s private and you’re not logged in
- It’s on a private registry
# Login to npm
npm login
# Check your auth
npm whoami
# Set registry for a scope
npm config set @company:registry https://npm.company.com/
Fix 4: Wrong Registry
Your npm might be pointing to the wrong registry.
# Check current registry
npm config get registry
# Reset to default
npm config set registry https://registry.npmjs.org/
# Check .npmrc for overrides
cat .npmrc
cat ~/.npmrc
Fix 5: Package Exists But Version Doesn’t
npm ERR! 404 'express@99.0.0' is not in this registry
# Check available versions
npm view express versions
# Install latest
npm install express@latest
# Install specific valid version
npm install express@4.18.2
Fix 6: Network / Cache Issue
# Clear npm cache
npm cache clean --force
# Try again
npm install