summaryrefslogtreecommitdiff
path: root/deps/npm/man/man1/npm-update.1
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/man/man1/npm-update.1')
-rw-r--r--deps/npm/man/man1/npm-update.162
1 files changed, 44 insertions, 18 deletions
diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1
index 3e492ebfac..d8ae500df0 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" "April 2018" "" ""
+.TH "NPM\-UPDATE" "1" "December 2017" "" ""
.SH "NAME"
\fBnpm-update\fR \- Update a package
.SH SYNOPSIS
@@ -25,17 +25,13 @@ packages\.
If no package name is specified, all packages in the specified location (global
or local) will be updated\.
.P
-As of \fB, the\fPnpm update\fBwill only inspect top\-level packages\.
-Prior versions of\fPnpm\fBwould also recursively inspect all dependencies\.
-To get the old behavior, use\fPnpm \-\-depth 9999 update`\.
-.P
-As of \fB, the\fPnpm update\fBwill change\fPpackage\.json\fBto save the
-new version as the minimum required dependency\. To get the old behavior,
-use\fPnpm update \-\-no\-save`\.
+As of \fBnpm@2\.6\.1\fP, the \fBnpm update\fP will only inspect top\-level packages\.
+Prior versions of \fBnpm\fP would also recursively inspect all dependencies\.
+To get the old behavior, use \fBnpm \-\-depth 9999 update\fP\|\.
.SH EXAMPLES
.P
-IMPORTANT VERSION NOTE: these examples assume \fBor later\. For
-older versions of\fPnpm\fB, you must specify\fP\-\-depth 0` to get the behavior
+IMPORTANT VERSION NOTE: these examples assume \fBnpm@2\.6\.1\fP or later\. For
+older versions of \fBnpm\fP, you must specify \fB\-\-depth 0\fP to get the behavior
described below\.
.P
For the examples below, assume that the current package is \fBapp\fP and it depends
@@ -71,7 +67,8 @@ If \fBapp\fP\|'s \fBpackage\.json\fP contains:
.fi
.RE
.P
-Then \fBnpm update\fP will install \fB, because\fP1\.2\.2\fBis\fPlatest\fBand\fP1\.2\.2\fBsatisfies\fP^1\.1\.1`\.
+Then \fBnpm update\fP will install \fBdep1@1\.2\.2\fP, because \fB1\.2\.2\fP is \fBlatest\fP and
+\fB1\.2\.2\fP satisfies \fB^1\.1\.1\fP\|\.
.SS Tilde Dependencies
.P
However, if \fBapp\fP\|'s \fBpackage\.json\fP contains:
@@ -84,9 +81,10 @@ However, if \fBapp\fP\|'s \fBpackage\.json\fP contains:
.fi
.RE
.P
-In this case, running \fBnpm update\fP will install \fB\|\. Even though the\fPlatest\fBtag points to\fP1\.2\.2\fB, this version does not satisfy\fP~1\.1\.1\fB, which is equivalent
-to\fP>=1\.1\.1 <1\.2\.0\fB\|\. So the highest\-sorting version that satisfies\fP~1\.1\.1\fBis used,
-which is\fP1\.1\.2`\.
+In this case, running \fBnpm update\fP will install \fBdep1@1\.1\.2\fP\|\. Even though the \fBlatest\fP
+tag points to \fB1\.2\.2\fP, this version does not satisfy \fB~1\.1\.1\fP, which is equivalent
+to \fB>=1\.1\.1 <1\.2\.0\fP\|\. So the highest\-sorting version that satisfies \fB~1\.1\.1\fP is used,
+which is \fB1\.1\.2\fP\|\.
.SS Caret Dependencies below 1\.0\.0
.P
Suppose \fBapp\fP has a caret dependency on a version below \fB1\.0\.0\fP, for example:
@@ -99,8 +97,8 @@ Suppose \fBapp\fP has a caret dependency on a version below \fB1\.0\.0\fP, for e
.fi
.RE
.P
-\fBnpm update\fP will install \fB, because there are no other
-versions which satisfy\fP^0\.2\.0`\.
+\fBnpm update\fP will install \fBdep1@0\.2\.0\fP, because there are no other
+versions which satisfy \fB^0\.2\.0\fP\|\.
.P
If the dependence were on \fB^0\.4\.0\fP:
.P
@@ -112,8 +110,36 @@ If the dependence were on \fB^0\.4\.0\fP:
.fi
.RE
.P
-Then \fBnpm update\fP will install \fB, because that is the highest\-sorting
-version that satisfies\fP^0\.4\.0\fB(\fP>= 0\.4\.0 <0\.5\.0`)
+Then \fBnpm update\fP will install \fBdep1@0\.4\.1\fP, because that is the highest\-sorting
+version that satisfies \fB^0\.4\.0\fP (\fB>= 0\.4\.0 <0\.5\.0\fP)
+.SS Recording Updates with \fB\-\-save\fP
+.P
+When you want to update a package and save the new version as
+the minimum required dependency in \fBpackage\.json\fP, you can use
+\fBnpm update \-S\fP or \fBnpm update \-\-save\fP\|\. For example if
+\fBpackage\.json\fP contains:
+.P
+.RS 2
+.nf
+"dependencies": {
+ "dep1": "^1\.1\.1"
+}
+.fi
+.RE
+.P
+Then \fBnpm update \-\-save\fP will install \fBdep1@1\.2\.2\fP (i\.e\., \fBlatest\fP),
+and \fBpackage\.json\fP will be modified:
+.P
+.RS 2
+.nf
+"dependencies": {
+ "dep1": "^1\.2\.2"
+}
+.fi
+.RE
+.P
+Note that \fBnpm\fP will only write an updated version to \fBpackage\.json\fP
+if it installs a new package\.
.SS Updating Globally\-Installed Packages
.P
\fBnpm update \-g\fP will apply the \fBupdate\fP action to each globally installed