npm
16 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 ERESOLVE unable to resolve dependency tree — how to fix
Fix "npm ERR! ERESOLVE unable to resolve dependency tree" by using --legacy-peer-deps, overrides, or resolving the conflicting version manually.
-
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.
-
package-lock.json conflict — how to resolve
Fix package-lock.json merge conflicts by deleting the lock file and regenerating it, or using npm-merge-driver for automated resolution.
-
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.
-
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 Cannot find module — how to fix
Fix "Cannot find module 'xyz'" 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 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.