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 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