Skip to content

Commit

Permalink
fix(docs): re-add --save and explanation of when it is useful
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Jan 14, 2021
1 parent a07bb8e commit 9b55b79
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions docs/content/commands/npm-uninstall.md
Expand Up @@ -7,7 +7,7 @@ description: Remove a package
### Synopsis

```bash
npm uninstall [<@scope>/]<pkg>[@<version>]... [--no-save]
npm uninstall [<@scope>/]<pkg>[@<version>]... [--save|--no-save]

aliases: remove, rm, r, un, unlink
```
Expand All @@ -24,9 +24,13 @@ It also removes the package from the `dependencies`, `devDependencies`,
Futher, if you have an `npm-shrinkwrap.json` or `package-lock.json`, npm
will update those files as well.

`npm uninstall` takes one optional flag, `--no-save` which will tell npm
not to remove the package from your `package.json`,
`npm-shrinkwrap.json`, or `package-lock.json` files
`--no-save` will tell npm not to remove the package from your
`package.json`, `npm-shrinkwrap.json`, or `package-lock.json` files.

`--save` will tell npm to remove the package from your `package.json`,
`npm-shrinkwrap.json`, and `package-lock.json` files. This is the
default, but you may need to use this if you have for instance
`save=false` in your `npmrc` file

In global mode (ie, with `-g` or `--global` appended to the command),
it uninstalls the current package context as a global package.
Expand Down
2 changes: 1 addition & 1 deletion lib/uninstall.js
Expand Up @@ -9,7 +9,7 @@ const completion = require('./utils/completion/installed-shallow.js')

const usage = usageUtil(
'uninstall',
'npm uninstall [<@scope>/]<pkg>[@<version>]... [--no-save]'
'npm uninstall [<@scope>/]<pkg>[@<version>]... [--save, --no-save]'
)

const cmd = (args, cb) => rm(args).then(() => cb()).catch(cb)
Expand Down

0 comments on commit 9b55b79

Please sign in to comment.