npm install <package>Install a runtime dependency.
Install, update, remove, lockfile, and local-development npm dependency workflows.
Install packages in different dependency buckets.
npm install <package>Install a runtime dependency.
npm install <package>@<version>Install an exact version.
npm install -D <package>Add a development dependency.
npm install -O <package>Add an optional dependency.
npm install -P <package>Add a peer dependency entry.
npm install --no-save <package>Install a package without editing package.json.
npm install -g <package>Install a CLI tool globally.
Change package versions and clean up dependencies.
npm uninstall <package>Remove a dependency and update manifests.
npm updateUpdate installed packages within semver ranges.
npm update <package>Update one installed package.
npm dedupeReduce duplicate package copies in the tree.
npm pruneDelete packages not listed in manifests.
npm find-dupesReport duplicate package copies in the tree.
Commands that matter for CI and predictable installs.
Perform a clean install while skipping lifecycle scripts.
npm ci --ignore-scriptsPerform a clean install while skipping lifecycle scripts.
npm install --package-lock-onlyUpdate package-lock.json without changing node_modules.
npm shrinkwrapCreate a publishable lockfile.
Bypass peer dependency auto-resolution conflicts.
npm install --legacy-peer-depsBypass peer dependency auto-resolution conflicts.
npm install --omit=devSkip devDependencies during install.
npm ci --omit=devUse lockfile while skipping devDependencies.
Useful local package development commands.
Register the current package for local linking.
npm linkRegister the current package for local linking.
Link a globally linked package into the current project.
npm link <package>Link a globally linked package into the current project.
npm packCreate a tarball from the current package.
npm install ./my-package-1.0.0.tgzInstall a package from a local tarball.