NPM-PRUNE(1)

NAME
npm-prune - Remove extraneous packages

SYNOPSIS

    npm prune [[<@scope>/]<pkg>...] [--production] [--dry-run] [--json]

DESCRIPTION

This command removes "extraneous" packages. If a package name is provided, then only packages matching one of the supplied names are removed.

Extraneous packages are packages that are not listed on the parent package's dependencies list.

If the flag is specified or the environment variable is set to , this command will remove the packages specified in your . Setting will negate being set to .

If the flag is used then no changes will actually be made.

If the flag is used then the changes made (or would have made with ) are printed as a JSON object.

In normal operation with package-locks enabled, extraneous modules are pruned automatically when modules are installed and you'll only need this command with the flag.

If you've disabled package-locks then extraneous modules will not be removed and it's up to you to run from time-to-time to remove them.

SEE ALSO

    •   npm help uninstall

    •   npm help 5 folders

    •   npm help ls