npm
Overview
npm coordinates JavaScript packages and project scripts. Start with the npm basics guide for manifests, lockfiles, dependency types, scripts, and reproducible installs, then use the references below for a specific failure.
17 pages
-
npm audit fix — resolve security vulnerabilities
Find and fix npm security vulnerabilities with npm audit and npm audit fix. Covers breaking changes, manual fixes, and audit levels.
-
npm engines field — require specific Node.js version
Use the engines field in package.json to declare required Node.js and npm versions. Covers npm engine-strict and .nvmrc.
-
npm ENOENT no such file or directory — how to fix
Fix npm "ENOENT: no such file or directory" errors during install, run, or build by checking paths, node_modules, and package.json.
-
npm peer dependency conflict / ERESOLVE — how to fix
Resolve npm ERESOLVE errors by identifying incompatible peer dependency ranges and installing versions that support each other.
-
eslint version conflict with TypeScript — how to fix
Fix ESLint and typescript-eslint version conflicts, including peer dependency issues between eslint@8/9 and @typescript-eslint packages.
-
npm link — use a local package without publishing
Use npm link to develop and test a local package in another project without publishing to the registry or package index.
-
package-lock.json conflict — how to resolve
Resolve a package-lock.json merge conflict while preserving reviewed dependency versions and the dependency changes from both branches.
-
npm peer dependency warning — how to handle
Understand and fix npm peer dependency warnings. Covers why they appear, when it is safe to ignore them, and how to install missing peer deps.
-
npm ERR! missing script — how to fix
Fix npm ERR! missing script by checking the script name, package.json location, workspace target, and whether the script exists under the scripts field.
-
cannot find module / npm module not found — how to fix
Fix "Cannot find module" and npm module not found errors in Node.js by installing the missing package, checking paths, and verifying module resolution.
-
npm node-gyp build failed — how to fix
Fix "node-gyp build failed" by installing Python, build tools (make, gcc), and the correct Node.js headers. Covers macOS, Linux, and Windows.
-
npm basics — package.json, dependencies, scripts, and reproducible installs
Understand package.json, package-lock.json, node_modules, dependency types, semantic versions, npm scripts, npm install, and reproducible npm ci workflows.
-
npm cache clean and verify — fix corrupted installs
Fix corrupted npm installs by cleaning the npm cache with npm cache clean --force or npm cache verify.
-
npm outdated — check for package updates
Use npm outdated to see which packages have newer versions, and npm update or manual version bumps to upgrade them.
-
npm private registry — configure .npmrc for authentication
Configure npm to use a private registry (Verdaccio, GitHub Packages, Artifactory, etc.) using .npmrc. Covers authentication and per-scope configuration.
-
npm scripts — define and run custom commands
Define and run npm scripts in package.json. Covers common patterns: chaining commands, passing arguments, lifecycle hooks, and cross-env.
-
@scope/package-name — install and use scoped npm packages
Install and configure scoped npm packages (@scope/package-name). Covers public scoped packages, private scopes, and registry configuration.