1NPM-UNINSTALL(1) NPM-UNINSTALL(1)
2
3
4
6 npm-uninstall - Remove a package
7
8 Synopsis
9 npm uninstall [<@scope>/]<pkg>[@<version>]... [-S|--save|--no-save]
10
11 aliases: remove, rm, r, un, unlink
12
13 Description
14 This uninstalls a package, completely removing everything npm installed
15 on its behalf.
16
17 It also removes the package from the dependencies, devDependencies, op‐
18 tionalDependencies, and peerDependencies objects in your package.json.
19
20 Futher, if you have an npm-shrinkwrap.json or package-lock.json, npm
21 will update those files as well.
22
23 --no-save will tell npm not to remove the package from your pack‐
24 age.json, npm-shrinkwrap.json, or package-lock.json files.
25
26 --save or -S will tell npm to remove the package from your pack‐
27 age.json, npm-shrinkwrap.json, and package-lock.json files. This is
28 the default, but you may need to use this if you have for instance
29 save=false in your npmrc file
30
31 In global mode (ie, with -g or --global appended to the command), it
32 uninstalls the current package context as a global package. --no-save
33 is ignored in this case.
34
35 Scope is optional and follows the usual rules for npm help scope.
36
37 Examples
38 npm uninstall sax
39
40 sax will no longer be in your package.json, npm-shrinkwrap.json, or
41 package-lock.json files.
42
43 npm uninstall lodash --no-save
44
45 lodash will not be removed from your package.json, npm-shrinkwrap.json,
46 or package-lock.json files.
47
48 Configuration
49 <!-- AUTOGENERATED CONFIG DESCRIPTIONS START --> <!-- automatically
50 generated, do not edit manually --> <!-- see lib/utils/config/defini‐
51 tions.js -->
52
53 save
54 • Default: true
55
56 • Type: Boolean
57
58
59 Save installed packages to a package.json file as dependencies.
60
61 When used with the npm rm command, removes the dependency from pack‐
62 age.json. <!-- automatically generated, do not edit manually --> <!--
63 see lib/utils/config/definitions.js -->
64
65
66 workspace
67 • Default:
68
69 • Type: String (can be set multiple times)
70
71
72 Enable running a command in the context of the configured workspaces of
73 the current project while filtering by running only the workspaces de‐
74 fined by this configuration option.
75
76 Valid values for the workspace config are either:
77
78 • Workspace names
79
80 • Path to a workspace directory
81
82 • Path to a parent workspace directory (will result to selecting all of
83 the nested workspaces)
84
85
86 When set for the npm init command, this may be set to the folder of a
87 workspace which does not yet exist, to create the folder and set it up
88 as a brand new workspace within the project.
89
90 This value is not exported to the environment for child processes.
91 <!-- automatically generated, do not edit manually --> <!-- see
92 lib/utils/config/definitions.js -->
93
94
95 workspaces
96 • Default: false
97
98 • Type: Boolean
99
100
101 Enable running a command in the context of all the configured
102 workspaces.
103
104 This value is not exported to the environment for child processes.
105 <!-- automatically generated, do not edit manually --> <!-- see
106 lib/utils/config/definitions.js -->
107
108 <!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
109
110
111 See Also
112 • npm help prune
113
114 • npm help install
115
116 • npm help folders
117
118 • npm help config
119
120 • npm help npmrc
121
122
123
124
125 October 2021 NPM-UNINSTALL(1)