The EMISSING error occurs when npm cannot find a required dependency during installation. This typically happens due to corrupted lockfiles, incomplete installations, or version mismatches between package.json and package-lock.json.
The EMISSING error indicates that npm's dependency resolver found a reference to a package that should exist but cannot be located. This happens when the dependency tree has become inconsistent—the lockfile or node_modules references a package that wasn't properly installed. This error commonly occurs after interrupted installations, when switching between npm and Yarn, or when package-lock.json becomes desynchronized from package.json. The error can also surface when optional dependencies have nested requirements that fail to install properly.
Delete both node_modules and lockfile to force a fresh dependency tree:
# Remove existing artifacts
rm -rf node_modules package-lock.json
# Reinstall from scratch
npm installThis forces npm to rebuild the entire dependency tree from package.json.
Remove potentially corrupted cache entries:
# Force clear the cache
npm cache clean --force
# Verify cache integrity
npm cache verify
# Then reinstall
npm installCheck if the package and version are available:
# View available versions
npm view <package-name> versions
# Install specific version if needed
npm install <package-name>@<version>If the version doesn't exist, update package.json to use an available version.
Use npm list to identify missing dependencies:
# Show full dependency tree
npm list
# Show only problems
npm list 2>&1 | grep -i "missing\|UNMET"Install any packages reported as missing.
Older npm versions have known dependency resolution bugs:
# Check current versions
node -v
npm -v
# Upgrade npm
npm install -g npm@latest
# Or use nvm for Node upgrade
nvm install --lts
nvm use --ltsIn CI/CD environments, use npm ci instead of npm install:
# Clean install from lockfile (requires package-lock.json)
npm cinpm ci is stricter and fails fast if lockfile doesn't match package.json.
This error is particularly common when teams mix npm and Yarn, or when CI/CD environments use different Node.js versions than local development. Always commit package-lock.json to version control and ensure consistent Node.js versions across environments.
For monorepos, EMISSING can occur when workspace packages reference each other incorrectly. Verify workspace configuration in package.json and ensure dependencies use the correct workspace protocol.
Prevention: Run npm audit regularly, use npm ci in CI pipelines, and avoid manual edits to package-lock.json.
npm notice access token expired or revoked. Please try logging in again.
Token has expired - npm authentication failure
npm ERR! code EAI_AGAIN
How to fix "EAI_AGAIN" in npm
npm error code E403 npm error 403 Forbidden - PUT https://registry.npmjs.org/<package>
How to fix 'E403 Forbidden' error in npm
npm ERR! code EUSAGE npm ERR! Usage error
How to fix "npm ERR! code EUSAGE" in Node.js projects
npm ERR! code E401 npm ERR! 401 Unauthorized
How to fix "E401 Unauthorized" in npm