2021-05-10 17:31:02 -04:00
|
|
|
.TH "NPM\-PRUNE" "1" "May 2021" "" ""
|
2011-11-26 09:21:03 -08:00
|
|
|
.SH "NAME"
|
2019-11-18 21:01:39 +02:00
|
|
|
\fBnpm-prune\fR \- Remove extraneous packages
|
2019-11-05 14:55:08 -05:00
|
|
|
.SS Synopsis
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
|
|
|
.RS 2
|
2014-11-04 15:08:12 -08:00
|
|
|
.nf
|
2018-04-20 18:26:37 -07:00
|
|
|
npm prune [[<@scope>/]<pkg>\.\.\.] [\-\-production] [\-\-dry\-run] [\-\-json]
|
2014-11-04 15:08:12 -08:00
|
|
|
.fi
|
2014-09-24 14:41:07 -07:00
|
|
|
.RE
|
2019-11-05 14:55:08 -05:00
|
|
|
.SS Description
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
2020-12-11 18:54:56 -05:00
|
|
|
This command removes "extraneous" packages\. If a package name is provided,
|
|
|
|
then only packages matching one of the supplied names are removed\.
|
2011-11-26 09:21:03 -08:00
|
|
|
.P
|
2020-12-11 18:54:56 -05:00
|
|
|
Extraneous packages are those present in the \fBnode_modules\fP folder that are
|
|
|
|
not listed as any package's dependency list\.
|
2013-10-24 09:21:59 -07:00
|
|
|
.P
|
2015-07-24 15:09:52 -07:00
|
|
|
If the \fB\-\-production\fP flag is specified or the \fBNODE_ENV\fP environment
|
|
|
|
variable is set to \fBproduction\fP, this command will remove the packages
|
2020-12-11 18:54:56 -05:00
|
|
|
specified in your \fBdevDependencies\fP\|\. Setting \fB\-\-no\-production\fP will negate
|
|
|
|
\fBNODE_ENV\fP being set to \fBproduction\fP\|\.
|
2018-04-20 18:26:37 -07:00
|
|
|
.P
|
|
|
|
If the \fB\-\-dry\-run\fP flag is used then no changes will actually be made\.
|
|
|
|
.P
|
2020-12-11 18:54:56 -05:00
|
|
|
If the \fB\-\-json\fP flag is used, then the changes \fBnpm prune\fP made (or would
|
2018-04-20 18:26:37 -07:00
|
|
|
have made with \fB\-\-dry\-run\fP) are printed as a JSON object\.
|
|
|
|
.P
|
2020-12-11 18:54:56 -05:00
|
|
|
In normal operation, extraneous modules are pruned automatically, so you'll
|
|
|
|
only need this command with the \fB\-\-production\fP flag\. However, in the real
|
|
|
|
world, operation is not always "normal"\. When crashes or mistakes happen,
|
|
|
|
this command can help clean up any resulting garbage\.
|
2019-11-05 14:55:08 -05:00
|
|
|
.SS See Also
|
2014-09-24 14:41:07 -07:00
|
|
|
.RS 0
|
|
|
|
.IP \(bu 2
|
2019-11-18 21:01:39 +02:00
|
|
|
npm help uninstall
|
2014-09-24 14:41:07 -07:00
|
|
|
.IP \(bu 2
|
2019-11-05 14:55:08 -05:00
|
|
|
npm help folders
|
2014-09-24 14:41:07 -07:00
|
|
|
.IP \(bu 2
|
2019-11-18 21:01:39 +02:00
|
|
|
npm help ls
|
2014-09-24 14:41:07 -07:00
|
|
|
|
|
|
|
.RE
|