diff --git a/docs/content/commands/npm-uninstall.md b/docs/content/commands/npm-uninstall.md index 155193e4f17f6..0d7a5bbe9fb95 100644 --- a/docs/content/commands/npm-uninstall.md +++ b/docs/content/commands/npm-uninstall.md @@ -7,7 +7,7 @@ description: Remove a package ### Synopsis ```bash -npm uninstall [<@scope>/][@]... [--no-save] +npm uninstall [<@scope>/][@]... [--save|--no-save] aliases: remove, rm, r, un, unlink ``` @@ -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. diff --git a/lib/uninstall.js b/lib/uninstall.js index 4638adc5f3e89..f020e95a4ad5f 100644 --- a/lib/uninstall.js +++ b/lib/uninstall.js @@ -9,7 +9,7 @@ const completion = require('./utils/completion/installed-shallow.js') const usage = usageUtil( 'uninstall', - 'npm uninstall [<@scope>/][@]... [--no-save]' + 'npm uninstall [<@scope>/][@]... [--save, --no-save]' ) const cmd = (args, cb) => rm(args).then(() => cb()).catch(cb)