npm
npm Error Codes
Error codes thrown by the npm CLI and Node package manager. These appear as the code property on errors and in npm's error output.
15 codes
· All codes 15 codes
- E404 Package Not Found The requested package does not exist in the registry. Verify the package name is spelled correctly and that you are pointing at the right registry (check .npmrc or the --registry flag).
- EACCES Permission Denied npm lacks permission to write to a directory, commonly the global node_modules or npm cache. Fix the directory ownership rather than using sudo: see the npm docs on fixing permissions. Using sudo with npm is generally discouraged.
- EAUDIT Audit Security Vulnerability npm audit found security vulnerabilities in the dependency tree. Review the report with npm audit and apply fixes with npm audit fix. Critical vulnerabilities block install when audit-level is set.
- EBADENGINE Incompatible Engine The installed Node.js or npm version does not satisfy the engines field required by a package. Upgrade Node.js/npm to a compatible version, or use a version manager such as nvm or fnm.
- ECONNREFUSED Connection Refused npm could not connect to the registry. The registry may be down, unreachable, or behind a proxy. Check your network connection and proxy settings (npm config get proxy).
- EINTEGRITY Integrity Checksum Mismatch The downloaded package content does not match the integrity hash recorded in package-lock.json. This can indicate a corrupted download or a tampered registry. Run npm cache clean --force and reinstall.
- EINVALIDPACKAGENAME Invalid Package Name The package name in package.json or specified on the command line does not conform to npm naming rules. Names must be lowercase, URL-safe, and not start with a dot or underscore.
- EJSONPARSE JSON Parse Error npm could not parse a JSON file, most commonly package.json or package-lock.json. Use a JSON linter to find the syntax error in the indicated file.
- ELIFECYCLE Lifecycle Script Failed A lifecycle script (install, build, test, etc.) exited with a non-zero status. The error output above this message shows the actual failure. Run the script directly to debug.
- ENEEDAUTH Authentication Required The registry requires authentication for this operation. Run npm login to authenticate, or provide an auth token in .npmrc for private registries.
- ENOLOCK No Lockfile The operation requires a package-lock.json or npm-shrinkwrap.json but none was found. Run npm install to generate one, or use npm install --package-lock to force creation.
- ENOSELF Cannot Install Self A package is trying to install itself as its own dependency, which creates a circular dependency. Check package.json dependencies for a package with the same name as the current project.
- ENOSPC No Space Left on Device The filesystem ran out of space during package extraction or cache writing. Free disk space and retry. The npm cache can be cleared with npm cache clean --force.
- ERESOLVE Dependency Resolution Failure npm cannot resolve a dependency tree that satisfies all peer dependency constraints. Use npm install --legacy-peer-deps to bypass strict peer checks, or npm install --force as a last resort. Review the conflict described in the error output.
- ETARGET No Matching Version No published version of the package satisfies the requested semver range. Check the version specifier in package.json and compare against versions available via npm view <package> versions.