LinuxCommandLibrary

npm-prune

removes packages not in dependencies

TLDR

Remove extraneous packages

$ npm prune
copy
Remove dev dependencies
$ npm prune --production
copy
Dry run
$ npm prune --dry-run
copy
JSON output
$ npm prune --json
copy

SYNOPSIS

npm prune [options]

DESCRIPTION

npm prune removes packages not in dependencies. Cleans up extraneous packages.
The command removes unlisted modules. Useful after dependency changes.

PARAMETERS

--production

Remove devDependencies.
--dry-run
Show what would be removed.
--json
JSON output format.
--help
Display help information.

CAVEATS

Removes packages. Use dry-run first. Production mode removes dev deps.

HISTORY

npm prune provides dependency cleanup by removing packages not listed in package.json.

SEE ALSO

npm(1), npm-ls(1), npm-dedupe(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community