Skip to content

Commit ccffe4a

Browse files
docs: use the latest version for global update and outdated's wanted (#9501)
Backport of #9401 to `release/v11`. Co-authored-by: Liang <github@liangmi.dev>
1 parent 66408d7 commit ccffe4a

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

docs/lib/content/commands/npm-outdated.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Use `--all` to find all outdated meta-dependencies as well.
1818
In the output:
1919

2020
* `wanted` is the maximum version of the package that satisfies the semver range specified in `package.json`.
21-
If there's no available semver range (i.e. you're running `npm outdated --global`, or the package isn't included in `package.json`), then `wanted` shows the currently-installed version.
21+
If there's no available semver range (i.e. you're running `npm outdated --global`, or the package isn't included in `package.json`), then `wanted` shows the latest version.
2222
* `latest` is the version of the package tagged as latest in the registry.
2323
Running `npm publish` with no special configuration will publish the package with a dist-tag of `latest`.
2424
This may or may not be the maximum version of the package, or the most-recently published version of the package, depending on how the package's developer manages the latest [dist-tag](/commands/npm-dist-tag).

docs/lib/content/commands/npm-update.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ In this case if you really did need your package to use a newer version you woul
128128

129129
`npm update -g` will apply the `update` action to each globally installed package that is `outdated` -- that is, has a version that is different from `wanted`.
130130

131-
Note: Globally installed packages are treated as if they are installed with a caret semver range specified.
132-
So if you require to update to `latest` you may need to run `npm install -g [<pkg>...]`
131+
Note: Globally installed packages do not have a `package.json` semver range available, so their `wanted` version is `latest`.
133132

134133
NOTE: If a package has been upgraded to a version newer than `latest`, it will be _downgraded_.
135134

0 commit comments

Comments
 (0)