@@ -7,7 +7,7 @@ description: Remove a package
7
7
### Synopsis
8
8
9
9
``` bash
10
- npm uninstall [< @scope> /]< pkg> [@< version> ]... [-S | --save | -D | --save-dev | -O | --save-optional | - -no-save]
10
+ npm uninstall [< @scope> /]< pkg> [@< version> ]... [--no-save]
11
11
12
12
aliases: remove, rm, r, un, unlink
13
13
```
@@ -17,40 +17,39 @@ aliases: remove, rm, r, un, unlink
17
17
This uninstalls a package, completely removing everything npm installed
18
18
on its behalf.
19
19
20
- Example:
20
+ It also removes the package from the ` dependencies ` , ` devDependencies ` ,
21
+ ` optionalDependencies ` , and ` peerDependencies ` objects in your
22
+ ` package.json ` .
21
23
22
- ``` bash
23
- npm uninstall sax
24
- ```
24
+ Futher, if you have an ` npm-shrinkwrap.json ` or ` package-lock.json ` , npm
25
+ will update those files as well.
26
+
27
+ ` npm uninstall ` takes one optional flag, ` --no-save ` which will tell npm
28
+ not to remove the package from your ` package.json ` ,
29
+ ` npm-shrinkwrap.json ` , or ` package-lock.json ` files
25
30
26
31
In global mode (ie, with ` -g ` or ` --global ` appended to the command),
27
32
it uninstalls the current package context as a global package.
33
+ ` --no-save ` is ignored in this case.
28
34
29
- ` npm uninstall ` takes 3 exclusive, optional flags which save or update
30
- the package version in your main package.json:
31
-
32
- * ` -S, --save ` : Package will be removed from your ` dependencies ` .
33
-
34
- * ` -D, --save-dev ` : Package will be removed from your ` devDependencies ` .
35
-
36
- * ` -O, --save-optional ` : Package will be removed from your ` optionalDependencies ` .
35
+ Scope is optional and follows the usual rules for [ ` scope ` ] ( /using-npm/scope ) .
37
36
38
- * ` --no-save ` : Package will not be removed from your ` package.json ` file.
37
+ ### Examples
39
38
40
- Further, if you have an ` npm-shrinkwrap.json ` then it will be updated as
41
- well.
39
+ ``` bash
40
+ npm uninstall sax
41
+ ```
42
42
43
- Scope is optional and follows the usual rules for [ ` scope ` ] ( /using-npm/scope ) .
43
+ sax will no longer be in your ` package.json ` , ` npm-shrinkwrap.json ` , or
44
+ ` package-lock.json ` files.
44
45
45
- Examples:
46
46
``` bash
47
- npm uninstall sax --save
48
- npm uninstall @myorg/privatepackage --save
49
- npm uninstall node-tap --save-dev
50
- npm uninstall dtrace-provider --save-optional
51
47
npm uninstall lodash --no-save
52
48
```
53
49
50
+ lodash will not be removed fromy your ` package.json ` ,
51
+ ` npm-shrinkwrap.json ` , or ` package-lock.json ` files.
52
+
54
53
### See Also
55
54
56
55
* [ npm prune] ( /commands/npm-prune )
0 commit comments