]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-update.1
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / man / man1 / npm-update.1
1 .TH "NPM\-UPDATE" "1" "October 2016" "" ""
2 .SH "NAME"
3 \fBnpm-update\fR \- Update a package
4 .SH SYNOPSIS
5 .P
6 .RS 2
7 .nf
8 npm update [\-g] [<name> [<name> \.\.\.]]
9
10 aliases: up, upgrade
11 .fi
12 .RE
13 .SH DESCRIPTION
14 .P
15 This command will update all the packages listed to the latest version
16 (specified by the \fBtag\fP config), respecting semver\.
17 .P
18 It will also install missing packages\. As with all commands that install
19 packages, the \fB\-\-dev\fP flag will cause \fBdevDependencies\fP to be processed
20 as well\.
21 .P
22 If the \fB\-g\fP flag is specified, this command will update globally installed
23 packages\.
24 .P
25 If no package name is specified, all packages in the specified location (global
26 or local) will be updated\.
27 .P
28 As of \fBnpm@2\.6\.1\fP, the \fBnpm update\fP will only inspect top\-level packages\.
29 Prior versions of \fBnpm\fP would also recursively inspect all dependencies\.
30 To get the old behavior, use \fBnpm \-\-depth 9999 update\fP\|\.
31 .SH EXAMPLES
32 .P
33 IMPORTANT VERSION NOTE: these examples assume \fBnpm@2\.6\.1\fP or later\.  For
34 older versions of \fBnpm\fP, you must specify \fB\-\-depth 0\fP to get the behavior
35 described below\.
36 .P
37 For the examples below, assume that the current package is \fBapp\fP and it depends
38 on dependencies, \fBdep1\fP (\fBdep2\fP, \.\. etc\.)\.  The published versions of \fBdep1\fP are:
39 .P
40 .RS 2
41 .nf
42 {
43   "dist\-tags": { "latest": "1\.2\.2" },
44   "versions": [
45     "1\.2\.2",
46     "1\.2\.1",
47     "1\.2\.0",
48     "1\.1\.2",
49     "1\.1\.1",
50     "1\.0\.0",
51     "0\.4\.1",
52     "0\.4\.0",
53     "0\.2\.0"
54   ]
55 }
56 .fi
57 .RE
58 .SS Caret Dependencies
59 .P
60 If \fBapp\fP\|'s \fBpackage\.json\fP contains:
61 .P
62 .RS 2
63 .nf
64 "dependencies": {
65   "dep1": "^1\.1\.1"
66 }
67 .fi
68 .RE
69 .P
70 Then \fBnpm update\fP will install \fBdep1@1\.2\.2\fP, because \fB1\.2\.2\fP is \fBlatest\fP and
71 \fB1\.2\.2\fP satisfies \fB^1\.1\.1\fP\|\.
72 .SS Tilde Dependencies
73 .P
74 However, if \fBapp\fP\|'s \fBpackage\.json\fP contains:
75 .P
76 .RS 2
77 .nf
78 "dependencies": {
79   "dep1": "~1\.1\.1"
80 }
81 .fi
82 .RE
83 .P
84 In this case, running \fBnpm update\fP will install \fBdep1@1\.1\.2\fP\|\.  Even though the \fBlatest\fP
85 tag points to \fB1\.2\.2\fP, this version does not satisfy \fB~1\.1\.1\fP, which is equivalent
86 to \fB>=1\.1\.1 <1\.2\.0\fP\|\.  So the highest\-sorting version that satisfies \fB~1\.1\.1\fP is used,
87 which is \fB1\.1\.2\fP\|\.
88 .SS Caret Dependencies below 1\.0\.0
89 .P
90 Suppose \fBapp\fP has a caret dependency on a version below \fB1\.0\.0\fP, for example:
91 .P
92 .RS 2
93 .nf
94 "dependencies": {
95   "dep1": "^0\.2\.0"
96 }
97 .fi
98 .RE
99 .P
100 \fBnpm update\fP will install \fBdep1@0\.2\.0\fP, because there are no other
101 versions which satisfy \fB^0\.2\.0\fP\|\.
102 .P
103 If the dependence were on \fB^0\.4\.0\fP:
104 .P
105 .RS 2
106 .nf
107 "dependencies": {
108   "dep1": "^0\.4\.0"
109 }
110 .fi
111 .RE
112 .P
113 Then \fBnpm update\fP will install \fBdep1@0\.4\.1\fP, because that is the highest\-sorting
114 version that satisfies \fB^0\.4\.0\fP (\fB>= 0\.4\.0 <0\.5\.0\fP)
115 .SS Recording Updates with \fB\-\-save\fP
116 .P
117 When you want to update a package and save the new version as
118 the minimum required dependency in \fBpackage\.json\fP, you can use
119 \fBnpm update \-\-save\fP\|\.  For example if \fBpackage\.json\fP contains
120 .P
121 .RS 2
122 .nf
123 "dependencies": {
124   "dep1": "^1\.1\.1"
125 }
126 .fi
127 .RE
128 .P
129 Then \fBnpm update \-\-save\fP will install \fBdep1@1\.2\.2\fP (i\.e\., \fBlatest\fP),
130 and \fBpackage\.json\fP will be modified:
131 .P
132 .RS 2
133 .nf
134 "dependencies": {
135   "dep1": "^1\.2\.2"
136 }
137 .fi
138 .RE
139 .P
140 Note that \fBnpm\fP will only write an updated version to \fBpackage\.json\fP
141 if it installs a new package\.
142 .SS Updating Globally\-Installed Packages
143 .P
144 \fBnpm update \-g\fP will apply the \fBupdate\fP action to each globally installed
145 package that is \fBoutdated\fP \-\- that is, has a version that is different from
146 \fBlatest\fP\|\.
147 .P
148 NOTE: If a package has been upgraded to a version newer than \fBlatest\fP, it will
149 be \fIdowngraded\fR\|\.
150 .SH SEE ALSO
151 .RS 0
152 .IP \(bu 2
153 npm help install
154 .IP \(bu 2
155 npm help outdated
156 .IP \(bu 2
157 npm help shrinkwrap
158 .IP \(bu 2
159 npm help 7 registry
160 .IP \(bu 2
161 npm help 5 folders
162 .IP \(bu 2
163 npm help ls
164
165 .RE
166