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