You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/commands/npm-update.md
+10-19Lines changed: 10 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: npm-update
3
3
section: 1
4
-
description: Update a package
4
+
description: Update packages
5
5
---
6
6
7
7
### Synopsis
@@ -27,22 +27,11 @@ packages.
27
27
If no package name is specified, all packages in the specified location (global
28
28
or local) will be updated.
29
29
30
-
As of `[email protected]`, the `npm update` will only inspect top-level packages.
31
-
Prior versions of `npm` would also recursively inspect all dependencies.
32
-
To get the old behavior, use `npm --depth 9999 update`.
33
-
34
-
As of `[email protected]`, the `npm update` will change `package.json` to save the
35
-
new version as the minimum required dependency. To get the old behavior,
36
-
use `npm update --no-save`.
37
-
38
30
### Example
39
31
40
-
IMPORTANT VERSION NOTE: these examples assume `[email protected]` or later. For
41
-
older versions of `npm`, you must specify `--depth 0` to get the behavior
42
-
described below.
43
-
44
32
For the examples below, assume that the current package is `app` and it depends
45
-
on dependencies, `dep1` (`dep2`, .. etc.). The published versions of `dep1` are:
33
+
on dependencies, `dep1` (`dep2`, .. etc.). The published versions of `dep1`
34
+
are:
46
35
47
36
```json
48
37
{
@@ -84,10 +73,10 @@ However, if `app`'s `package.json` contains:
84
73
}
85
74
```
86
75
87
-
In this case, running `npm update` will install `[email protected]`. Even though the`latest`
88
-
tag points to `1.2.2`, this version does not satisfy `~1.1.1`, which is equivalent
89
-
to `>=1.1.1 <1.2.0`. So the highest-sorting version that satisfies`~1.1.1` is used,
90
-
which is `1.1.2`.
76
+
In this case, running `npm update` will install `[email protected]`. Even though the
77
+
`latest`tag points to `1.2.2`, this version do not satisfy `~1.1.1`, which is
78
+
equivalent to `>=1.1.1 <1.2.0`. So the highest-sorting version that satisfies
79
+
`~1.1.1` is used, which is `1.1.2`.
91
80
92
81
#### Caret Dependencies below 1.0.0
93
82
@@ -120,7 +109,9 @@ version that satisfies `^0.4.0` (`>= 0.4.0 <0.5.0`)
120
109
package that is `outdated` -- that is, has a version that is different from
121
110
`wanted`.
122
111
123
-
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 [<pkg>...]`
112
+
Note: Globally installed packages are treated as if they are installed with a
113
+
caret semver range specified. So if you require to update to `latest` you may
114
+
need to run `npm install -g [<pkg>...]`
124
115
125
116
NOTE: If a package has been upgraded to a version newer than `latest`, it will
0 commit comments