summaryrefslogtreecommitdiff
path: root/deps/npm/html/doc/cli/npm-update.html
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/html/doc/cli/npm-update.html')
-rw-r--r--deps/npm/html/doc/cli/npm-update.html48
1 files changed, 31 insertions, 17 deletions
diff --git a/deps/npm/html/doc/cli/npm-update.html b/deps/npm/html/doc/cli/npm-update.html
index 588ca80be2..ddaf4104df 100644
--- a/deps/npm/html/doc/cli/npm-update.html
+++ b/deps/npm/html/doc/cli/npm-update.html
@@ -24,15 +24,12 @@ as well.</p>
packages.</p>
<p>If no package name is specified, all packages in the specified location (global
or local) will be updated.</p>
-<p>As of <a href="mailto:`npm@2.6.1">`npm@2.6.1</a><code>, the</code>npm update<code>will only inspect top-level packages.
-Prior versions of</code>npm<code>would also recursively inspect all dependencies.
-To get the old behavior, use</code>npm --depth 9999 update`.</p>
-<p>As of <a href="mailto:`npm@5.0.0">`npm@5.0.0</a><code>, the</code>npm update<code>will change</code>package.json<code>to save the
-new version as the minimum required dependency. To get the old behavior,
-use</code>npm update --no-save`.</p>
+<p>As of <code>npm@2.6.1</code>, the <code>npm update</code> will only inspect top-level packages.
+Prior versions of <code>npm</code> would also recursively inspect all dependencies.
+To get the old behavior, use <code>npm --depth 9999 update</code>.</p>
<h2 id="examples">EXAMPLES</h2>
-<p>IMPORTANT VERSION NOTE: these examples assume <a href="mailto:`npm@2.6.1">`npm@2.6.1</a><code>or later. For
-older versions of</code>npm<code>, you must specify</code>--depth 0` to get the behavior
+<p>IMPORTANT VERSION NOTE: these examples assume <code>npm@2.6.1</code> or later. For
+older versions of <code>npm</code>, you must specify <code>--depth 0</code> to get the behavior
described below.</p>
<p>For the examples below, assume that the current package is <code>app</code> and it depends
on dependencies, <code>dep1</code> (<code>dep2</code>, .. etc.). The published versions of <code>dep1</code> are:</p>
@@ -55,28 +52,45 @@ on dependencies, <code>dep1</code> (<code>dep2</code>, .. etc.). The published
<pre><code>&quot;dependencies&quot;: {
&quot;dep1&quot;: &quot;^1.1.1&quot;
}
-</code></pre><p>Then <code>npm update</code> will install <a href="mailto:`dep1@1.2.2">`dep1@1.2.2</a><code>, because</code>1.2.2<code>is</code>latest<code>and</code>1.2.2<code>satisfies</code>^1.1.1`.</p>
+</code></pre><p>Then <code>npm update</code> will install <code>dep1@1.2.2</code>, because <code>1.2.2</code> is <code>latest</code> and
+<code>1.2.2</code> satisfies <code>^1.1.1</code>.</p>
<h3 id="tilde-dependencies">Tilde Dependencies</h3>
<p>However, if <code>app</code>&#39;s <code>package.json</code> contains:</p>
<pre><code>&quot;dependencies&quot;: {
&quot;dep1&quot;: &quot;~1.1.1&quot;
}
-</code></pre><p>In this case, running <code>npm update</code> will install <a href="mailto:`dep1@1.1.2">`dep1@1.1.2</a><code>. Even though the</code>latest<code>tag points to</code>1.2.2<code>, this version does not satisfy</code>~1.1.1<code>, which is equivalent
-to</code>&gt;=1.1.1 &lt;1.2.0<code>. So the highest-sorting version that satisfies</code>~1.1.1<code>is used,
-which is</code>1.1.2`.</p>
+</code></pre><p>In this case, running <code>npm update</code> will install <code>dep1@1.1.2</code>. Even though the <code>latest</code>
+tag points to <code>1.2.2</code>, this version does not satisfy <code>~1.1.1</code>, which is equivalent
+to <code>&gt;=1.1.1 &lt;1.2.0</code>. So the highest-sorting version that satisfies <code>~1.1.1</code> is used,
+which is <code>1.1.2</code>.</p>
<h3 id="caret-dependencies-below-1-0-0">Caret Dependencies below 1.0.0</h3>
<p>Suppose <code>app</code> has a caret dependency on a version below <code>1.0.0</code>, for example:</p>
<pre><code>&quot;dependencies&quot;: {
&quot;dep1&quot;: &quot;^0.2.0&quot;
}
-</code></pre><p><code>npm update</code> will install <a href="mailto:`dep1@0.2.0">`dep1@0.2.0</a><code>, because there are no other
-versions which satisfy</code>^0.2.0`.</p>
+</code></pre><p><code>npm update</code> will install <code>dep1@0.2.0</code>, because there are no other
+versions which satisfy <code>^0.2.0</code>.</p>
<p>If the dependence were on <code>^0.4.0</code>:</p>
<pre><code>&quot;dependencies&quot;: {
&quot;dep1&quot;: &quot;^0.4.0&quot;
}
-</code></pre><p>Then <code>npm update</code> will install <a href="mailto:`dep1@0.4.1">`dep1@0.4.1</a><code>, because that is the highest-sorting
-version that satisfies</code>^0.4.0<code>(</code>&gt;= 0.4.0 &lt;0.5.0`)</p>
+</code></pre><p>Then <code>npm update</code> will install <code>dep1@0.4.1</code>, because that is the highest-sorting
+version that satisfies <code>^0.4.0</code> (<code>&gt;= 0.4.0 &lt;0.5.0</code>)</p>
+<h3 id="recording-updates-with-save-">Recording Updates with <code>--save</code></h3>
+<p>When you want to update a package and save the new version as
+the minimum required dependency in <code>package.json</code>, you can use
+<code>npm update -S</code> or <code>npm update --save</code>. For example if
+<code>package.json</code> contains:</p>
+<pre><code>&quot;dependencies&quot;: {
+ &quot;dep1&quot;: &quot;^1.1.1&quot;
+}
+</code></pre><p>Then <code>npm update --save</code> will install <code>dep1@1.2.2</code> (i.e., <code>latest</code>),
+and <code>package.json</code> will be modified:</p>
+<pre><code>&quot;dependencies&quot;: {
+ &quot;dep1&quot;: &quot;^1.2.2&quot;
+}
+</code></pre><p>Note that <code>npm</code> will only write an updated version to <code>package.json</code>
+if it installs a new package.</p>
<h3 id="updating-globally-installed-packages">Updating Globally-Installed Packages</h3>
<p><code>npm update -g</code> will apply the <code>update</code> action to each globally installed
package that is <code>outdated</code> -- that is, has a version that is different from
@@ -104,5 +118,5 @@ be <em>downgraded</em>.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-update &mdash; npm@5.8.0</p>
+<p id="footer">npm-update &mdash; npm@5.6.0</p>