diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2015-03-06 02:57:32 -0600 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2015-03-06 11:20:05 -0500 |
commit | fe14802fb700c5fea08b7c54f4298c3ac44a5c15 (patch) | |
tree | 74b43bf61e98f366089a416e4fe36b2f1256cd5d /deps/npm/man/man1/npm-update.1 | |
parent | c09c90c1a9e74ee4f29a051daf10bc4c5d5f7755 (diff) | |
download | node-new-fe14802fb700c5fea08b7c54f4298c3ac44a5c15.tar.gz |
deps: upgrade npm to 2.7.0
PR-URL: https://github.com/iojs/io.js/pull/1080
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/npm/man/man1/npm-update.1')
-rw-r--r-- | deps/npm/man/man1/npm-update.1 | 139 |
1 files changed, 137 insertions, 2 deletions
diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index b200ad94c1..a8ee566e08 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UPDATE" "1" "February 2015" "" "" +.TH "NPM\-UPDATE" "1" "March 2015" "" "" .SH "NAME" \fBnpm-update\fR \- Update a package .SH SYNOPSIS @@ -11,7 +11,7 @@ npm update [\-g] [<name> [<name> \.\.\.]] .SH DESCRIPTION .P This command will update all the packages listed to the latest version -(specified by the \fBtag\fR config)\. +(specified by the \fBtag\fR config), respecting semver\. .P It will also install missing packages\. As with all commands that install packages, the \fB\-\-dev\fR flag will cause \fBdevDependencies\fR to be processed @@ -22,6 +22,139 @@ packages\. .P If no package name is specified, all packages in the specified location (global or local) will be updated\. +.P +As of \fBnpm@2\.6\.1\fR, the \fBnpm update\fR will only inspect top\-level packages\. +Prior versions of \fBnpm\fR would also recursively inspect all dependencies\. +To get the old behavior, use \fBnpm \-\-depth 9999 update\fR, but be warned that +simultaneous asynchronous update of all packages, including \fBnpm\fR itself +and packages that \fBnpm\fR depends on, often causes problems up to and including +the uninstallation of \fBnpm\fR itself\. +.P +To restore a missing \fBnpm\fR, use the command: +.P +.RS 2 +.nf +curl \-L https://npmjs\.com/install\.sh | sh +.fi +.RE +.SH EXAMPLES +.P +IMPORTANT VERSION NOTE: these examples assume \fBnpm@2\.6\.1\fR or later\. For +older versions of \fBnpm\fR, you must specify \fB\-\-depth 0\fR to get the behavior +described below\. +.P +For the examples below, assume that the current package is \fBapp\fR and it depends +on dependencies, \fBdep1\fR (\fBdep2\fR, \.\. etc\.)\. The published versions of \fBdep1\fR are: +.P +.RS 2 +.nf +{ + dist\-tags: { latest: "1\.2\.2" }, + versions: { "1\.2\.2", + "1\.2\.1", + "1\.2\.0", + "1\.1\.2", + "1\.1\.1", + "1\.0\.0", + "0\.4\.1", + "0\.4\.0", + "0\.2\.0" + } +} +.fi +.RE +.SS Caret Dependencies +.P +If \fBapp\fR\|'s \fBpackage\.json\fR contains: +.P +.RS 2 +.nf +dependencies: { + dep1: "^1\.1\.1" +} +.fi +.RE +.P +Then \fBnpm update\fR will install \fBdep1@1\.2\.2\fR, because \fB1\.2\.2\fR is \fBlatest\fR and +\fB1\.2\.2\fR satisfies \fB^1\.1\.1\fR\|\. +.SS Tilde Dependencies +.P +However, if \fBapp\fR\|'s \fBpackage\.json\fR contains: +.P +.RS 2 +.nf +dependencies: { + dep1: "~1\.1\.1" +} +.fi +.RE +.P +In this case, running \fBnpm update\fR will install \fBdep1@1\.1\.2\fR\|\. Even though the \fBlatest\fR +tag points to \fB1\.2\.2\fR, this version does not satisfy \fB~1\.1\.1\fR, which is equivalent +to \fB>=1\.1\.1 <1\.2\.0\fR\|\. So the highest\-sorting version that satisfies \fB~1\.1\.1\fR is used, +which is \fB1\.1\.2\fR\|\. +.SS Caret Dependencies below 1\.0\.0 +.P +Suppose \fBapp\fR has a caret dependency on a version below \fB1\.0\.0\fR, for example: +.P +.RS 2 +.nf +dependencies: { + dep1: "^0\.2\.0" +} +.fi +.RE +.P +\fBnpm update\fR will install \fBdep1@0\.2\.0\fR, because there are no other +versions which satisfy \fB^0\.2\.0\fR\|\. +.P +If the dependence were on \fB^0\.4\.0\fR: +.P +.RS 2 +.nf +dependencies: { + dep1: "^0\.4\.0" +} +.fi +.RE +.P +Then \fBnpm update\fR will install \fBdep1@0\.4\.1\fR, because that is the highest\-sorting +version that satisfies \fB^0\.4\.0\fR (\fB>= 0\.4\.0 <0\.5\.0\fR) +.SS Recording Updates with \fB\-\-save\fR +.P +When you want to update a package and save the new version as +the minimum required dependency in \fBpackage\.json\fR, you can use +\fBnpm update \-\-save\fR\|\. For example if \fBpackage\.json\fR contains +.P +.RS 2 +.nf +dependencies: { + dep1: "^1\.1\.1" +} +.fi +.RE +.P +Then \fBnpm update \-\-save\fR will install \fBdep1@1\.2\.2\fR (i\.e\., \fBlatest\fR), +and \fBpackage\.json\fR will be modified: +.P +.RS 2 +.nf +dependencies: { + dep1: "^1\.2\.2" +} +.fi +.RE +.P +Note that \fBnpm\fR will only write an updated version to \fBpackage\.json\fR +if it installs a new package\. +.SS Updating Globally\-Installed Packages +.P +\fBnpm update \-g\fR will apply the \fBupdate\fR action to each globally\- installed +package that is \fBoutdated\fR \-\- that is, has a version that is different from +\fBlatest\fR\|\. +.P +NOTE: If a package has been upgraded to a version newer than \fBlatest\fR, it will +be \fIdowngraded\fR\|\. .SH SEE ALSO .RS 0 .IP \(bu 2 @@ -29,6 +162,8 @@ npm help install .IP \(bu 2 npm help outdated .IP \(bu 2 +npm help shrinkwrap +.IP \(bu 2 npm help 7 registry .IP \(bu 2 npm help 5 folders |