]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-update.html
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / html / doc / cli / npm-update.html
1 <!doctype html>
2 <html>
3   <title>npm-update</title>
4   <meta charset="utf-8">
5   <link rel="stylesheet" type="text/css" href="../../static/style.css">
6   <link rel="canonical" href="https://www.npmjs.org/doc/cli/npm-update.html">
7   <script async=true src="../../static/toc.js"></script>
8
9   <body>
10     <div id="wrapper">
11
12 <h1><a href="../cli/npm-update.html">npm-update</a></h1> <p>Update a package</p>
13 <h2 id="synopsis">SYNOPSIS</h2>
14 <pre><code>npm update [-g] [&lt;name&gt; [&lt;name&gt; ...]]
15
16 aliases: up, upgrade
17 </code></pre><h2 id="description">DESCRIPTION</h2>
18 <p>This command will update all the packages listed to the latest version
19 (specified by the <code>tag</code> config), respecting semver.</p>
20 <p>It will also install missing packages. As with all commands that install
21 packages, the <code>--dev</code> flag will cause <code>devDependencies</code> to be processed
22 as well.</p>
23 <p>If the <code>-g</code> flag is specified, this command will update globally installed
24 packages.</p>
25 <p>If no package name is specified, all packages in the specified location (global
26 or local) will be updated.</p>
27 <p>As of <code>npm@2.6.1</code>, the <code>npm update</code> will only inspect top-level packages.
28 Prior versions of <code>npm</code> would also recursively inspect all dependencies.
29 To get the old behavior, use <code>npm --depth 9999 update</code>.</p>
30 <h2 id="examples">EXAMPLES</h2>
31 <p>IMPORTANT VERSION NOTE: these examples assume <code>npm@2.6.1</code> or later.  For
32 older versions of <code>npm</code>, you must specify <code>--depth 0</code> to get the behavior
33 described below.</p>
34 <p>For the examples below, assume that the current package is <code>app</code> and it depends
35 on dependencies, <code>dep1</code> (<code>dep2</code>, .. etc.).  The published versions of <code>dep1</code> are:</p>
36 <pre><code>{
37   &quot;dist-tags&quot;: { &quot;latest&quot;: &quot;1.2.2&quot; },
38   &quot;versions&quot;: [
39     &quot;1.2.2&quot;,
40     &quot;1.2.1&quot;,
41     &quot;1.2.0&quot;,
42     &quot;1.1.2&quot;,
43     &quot;1.1.1&quot;,
44     &quot;1.0.0&quot;,
45     &quot;0.4.1&quot;,
46     &quot;0.4.0&quot;,
47     &quot;0.2.0&quot;
48   ]
49 }
50 </code></pre><h3 id="caret-dependencies">Caret Dependencies</h3>
51 <p>If <code>app</code>&#39;s <code>package.json</code> contains:</p>
52 <pre><code>&quot;dependencies&quot;: {
53   &quot;dep1&quot;: &quot;^1.1.1&quot;
54 }
55 </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
56 <code>1.2.2</code> satisfies <code>^1.1.1</code>.</p>
57 <h3 id="tilde-dependencies">Tilde Dependencies</h3>
58 <p>However, if <code>app</code>&#39;s <code>package.json</code> contains:</p>
59 <pre><code>&quot;dependencies&quot;: {
60   &quot;dep1&quot;: &quot;~1.1.1&quot;
61 }
62 </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>
63 tag points to <code>1.2.2</code>, this version does not satisfy <code>~1.1.1</code>, which is equivalent
64 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,
65 which is <code>1.1.2</code>.</p>
66 <h3 id="caret-dependencies-below-1-0-0">Caret Dependencies below 1.0.0</h3>
67 <p>Suppose <code>app</code> has a caret dependency on a version below <code>1.0.0</code>, for example:</p>
68 <pre><code>&quot;dependencies&quot;: {
69   &quot;dep1&quot;: &quot;^0.2.0&quot;
70 }
71 </code></pre><p><code>npm update</code> will install <code>dep1@0.2.0</code>, because there are no other
72 versions which satisfy <code>^0.2.0</code>.</p>
73 <p>If the dependence were on <code>^0.4.0</code>:</p>
74 <pre><code>&quot;dependencies&quot;: {
75   &quot;dep1&quot;: &quot;^0.4.0&quot;
76 }
77 </code></pre><p>Then <code>npm update</code> will install <code>dep1@0.4.1</code>, because that is the highest-sorting
78 version that satisfies <code>^0.4.0</code> (<code>&gt;= 0.4.0 &lt;0.5.0</code>)</p>
79 <h3 id="recording-updates-with-save-">Recording Updates with <code>--save</code></h3>
80 <p>When you want to update a package and save the new version as
81 the minimum required dependency in <code>package.json</code>, you can use
82 <code>npm update --save</code>.  For example if <code>package.json</code> contains</p>
83 <pre><code>&quot;dependencies&quot;: {
84   &quot;dep1&quot;: &quot;^1.1.1&quot;
85 }
86 </code></pre><p>Then <code>npm update --save</code> will install <code>dep1@1.2.2</code> (i.e., <code>latest</code>),
87 and <code>package.json</code> will be modified:</p>
88 <pre><code>&quot;dependencies&quot;: {
89   &quot;dep1&quot;: &quot;^1.2.2&quot;
90 }
91 </code></pre><p>Note that <code>npm</code> will only write an updated version to <code>package.json</code>
92 if it installs a new package.</p>
93 <h3 id="updating-globally-installed-packages">Updating Globally-Installed Packages</h3>
94 <p><code>npm update -g</code> will apply the <code>update</code> action to each globally installed
95 package that is <code>outdated</code> -- that is, has a version that is different from
96 <code>latest</code>.</p>
97 <p>NOTE: If a package has been upgraded to a version newer than <code>latest</code>, it will
98 be <em>downgraded</em>.</p>
99 <h2 id="see-also">SEE ALSO</h2>
100 <ul>
101 <li><a href="../cli/npm-install.html">npm-install(1)</a></li>
102 <li><a href="../cli/npm-outdated.html">npm-outdated(1)</a></li>
103 <li><a href="../cli/npm-shrinkwrap.html">npm-shrinkwrap(1)</a></li>
104 <li><a href="../misc/npm-registry.html">npm-registry(7)</a></li>
105 <li><a href="../files/npm-folders.html">npm-folders(5)</a></li>
106 <li><a href="../cli/npm-ls.html">npm-ls(1)</a></li>
107 </ul>
108
109 </div>
110
111 <table border=0 cellspacing=0 cellpadding=0 id=npmlogo>
112 <tr><td style="width:180px;height:10px;background:rgb(237,127,127)" colspan=18>&nbsp;</td></tr>
113 <tr><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td><td style="width:40px;height:10px;background:#fff" colspan=4>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4>&nbsp;</td><td style="width:40px;height:10px;background:#fff" colspan=4>&nbsp;</td><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td><td colspan=6 style="width:60px;height:10px;background:#fff">&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4>&nbsp;</td></tr>
114 <tr><td colspan=2 style="width:20px;height:30px;background:#fff" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:20px;height:10px;background:#fff" rowspan=4 colspan=2>&nbsp;</td><td style="width:10px;height:20px;background:rgb(237,127,127)" rowspan=2>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:20px;height:10px;background:#fff" rowspan=3 colspan=2>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td></tr>
115 <tr><td style="width:10px;height:10px;background:#fff" rowspan=2>&nbsp;</td></tr>
116 <tr><td style="width:10px;height:10px;background:#fff">&nbsp;</td></tr>
117 <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>
118 <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>
119 </table>
120 <p id="footer">npm-update &mdash; npm@2.15.11</p>
121