npm prune [[<@scope>/]<pkg>]

Remove extraneous packages

Arguments

NameDescription
[<@scope>/]<pkg>

Options

NameDescription
--omit <Package type>
  • Repeatable ♾
  • Repeatable 3x
--dry-runIndicates that you don't want npm to make any changes and that it should only report what it would have done
--jsonShow output in json format
--productionRemove the packages specified in your devDependencies
-w, --workspace <workspace...>Enable running a command in the context of the configured workspaces of the current project
-ws, --workspacesEnable running a command in the context of all the configured workspaces