1 ---
2 title: npm-uninstall
3 section: 1
4 description: Remove a package
5 github_repo: npm/cli
6 github_branch: release/v6
7 github_path: docs/content/commands/npm-uninstall.md
8 redirect_from:
9 - /cli-documentation/v6/cli-commands/npm-uninstall
10 - /cli-documentation/v6/cli-commands/uninstall
11 - /cli-documentation/v6/commands/npm-uninstall
12 - /cli-documentation/v6/commands/uninstall
13 - /cli-documentation/v6/npm-uninstall
14 - /cli-documentation/v6/uninstall
15 - /cli/v6/cli-commands/npm-uninstall
16 - /cli/v6/cli-commands/uninstall
17 - /cli/v6/commands/uninstall
18 - /cli/v6/npm-uninstall
19 - /cli/v6/uninstall
20 ---
21
22 ### Synopsis
23
24 ```bash
25 npm uninstall [<@scope>/]<pkg>[@<version>]... [-S|--save|-D|--save-dev|-O|--save-optional|--no-save]
26
27 aliases: remove, rm, r, un, unlink
28 ```
29
30 ### Description
31
32 This uninstalls a package, completely removing everything npm installed on its behalf.
33
34 Example:
35
36 ```bash
37 npm uninstall sax
38 ```
39
40 In global mode (ie, with `-g` or `--global` appended to the command), it uninstalls the current package context as a global package.
41
42 `npm uninstall` takes 3 exclusive, optional flags which save or update the package version in your main package.json:
43
44 - `-S, --save`: Package will be removed from your `dependencies`.
45
46 - `-D, --save-dev`: Package will be removed from your `devDependencies`.
47
48 - `-O, --save-optional`: Package will be removed from your `optionalDependencies`.
49
50 - `--no-save`: Package will not be removed from your `package.json` file.
51
52 Further, if you have an `npm-shrinkwrap.json` then it will be updated as well.
53
54 Scope is optional and follows the usual rules for [`scope`](/cli/v6/using-npm/scope).
55
56 Examples:
57
58 ```bash
59 npm uninstall sax --save
60 npm uninstall @myorg/privatepackage --save
61 npm uninstall node-tap --save-dev
62 npm uninstall dtrace-provider --save-optional
63 npm uninstall lodash --no-save
64 ```
65
66 ### See Also
67
68 - [npm prune](/cli/v6/commands/npm-prune)
69 - [npm install](/cli/v6/commands/npm-install)
70 - [npm folders](/cli/v6/configuring-npm/folders)
71 - [npm config](/cli/v6/commands/npm-config)
72 - [npmrc](/cli/v6/configuring-npm/npmrc)