diff --git a/docs/content/commands/npm-update.md b/docs/content/commands/npm-update.md index 424d686189dca..012c8472c93fe 100644 --- a/docs/content/commands/npm-update.md +++ b/docs/content/commands/npm-update.md @@ -1,7 +1,7 @@ --- title: npm-update section: 1 -description: Update a package +description: Update packages --- ### Synopsis @@ -27,22 +27,11 @@ packages. If no package name is specified, all packages in the specified location (global or local) will be updated. -As of `npm@2.6.1`, the `npm update` will only inspect top-level packages. -Prior versions of `npm` would also recursively inspect all dependencies. -To get the old behavior, use `npm --depth 9999 update`. - -As of `npm@5.0.0`, the `npm update` will change `package.json` to save the -new version as the minimum required dependency. To get the old behavior, -use `npm update --no-save`. - ### Example -IMPORTANT VERSION NOTE: these examples assume `npm@2.6.1` or later. For -older versions of `npm`, you must specify `--depth 0` to get the behavior -described below. - For the examples below, assume that the current package is `app` and it depends -on dependencies, `dep1` (`dep2`, .. etc.). The published versions of `dep1` are: +on dependencies, `dep1` (`dep2`, .. etc.). The published versions of `dep1` +are: ```json { @@ -84,10 +73,10 @@ However, if `app`'s `package.json` contains: } ``` -In this case, running `npm update` will install `dep1@1.1.2`. Even though the `latest` -tag points to `1.2.2`, this version does not satisfy `~1.1.1`, which is equivalent -to `>=1.1.1 <1.2.0`. So the highest-sorting version that satisfies `~1.1.1` is used, -which is `1.1.2`. +In this case, running `npm update` will install `dep1@1.1.2`. Even though the +`latest` tag points to `1.2.2`, this version do not satisfy `~1.1.1`, which is +equivalent to `>=1.1.1 <1.2.0`. So the highest-sorting version that satisfies +`~1.1.1` is used, which is `1.1.2`. #### Caret Dependencies below 1.0.0 @@ -120,7 +109,9 @@ version that satisfies `^0.4.0` (`>= 0.4.0 <0.5.0`) package that is `outdated` -- that is, has a version that is different from `wanted`. -Note: Globally installed packages are treated as if they are installed with a caret semver range specified. So if you require to update to `latest` you may need to run `npm install -g [...]` +Note: Globally installed packages are treated as if they are installed with a +caret semver range specified. So if you require to update to `latest` you may +need to run `npm install -g [...]` NOTE: If a package has been upgraded to a version newer than `latest`, it will be _downgraded_.