Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
7.1 KiB

  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. <body>
  9. <div id="wrapper">
  10. <h1><a href="../cli/npm-update.html">npm-update</a></h1> <p>Update a package</p>
  11. <h2 id="synopsis">SYNOPSIS</h2>
  12. <pre><code>npm update [-g] [&lt;pkg&gt;...]
  13. aliases: up, upgrade</code></pre><h2 id="description">DESCRIPTION</h2>
  14. <p>This command will update all the packages listed to the latest version
  15. (specified by the <code>tag</code> config), respecting semver.</p>
  16. <p>It will also install missing packages. As with all commands that install
  17. packages, the <code>--dev</code> flag will cause <code>devDependencies</code> to be processed
  18. as well.</p>
  19. <p>If the <code>-g</code> flag is specified, this command will update globally installed
  20. packages.</p>
  21. <p>If no package name is specified, all packages in the specified location (global
  22. or local) will be updated.</p>
  23. <p>As of <a href="mailto:%60npm@2.6.1">`npm@2.6.1</a><code>, the</code>npm update<code>will only inspect top-level packages.
  24. Prior versions of</code>npm<code>would also recursively inspect all dependencies.
  25. To get the old behavior, use</code>npm --depth 9999 update`.</p>
  26. <p>As of <a href="mailto:%60npm@5.0.0">`npm@5.0.0</a><code>, the</code>npm update<code>will change</code>package.json<code>to save the
  27. new version as the minimum required dependency. To get the old behavior,
  28. use</code>npm update --no-save`.</p>
  29. <h2 id="examples">EXAMPLES</h2>
  30. <p>IMPORTANT VERSION NOTE: these examples assume <a href="mailto:%60npm@2.6.1">`npm@2.6.1</a><code>or later. For
  31. older versions of</code>npm<code>, you must specify</code>--depth 0` to get the behavior
  32. described below.</p>
  33. <p>For the examples below, assume that the current package is <code>app</code> and it depends
  34. on dependencies, <code>dep1</code> (<code>dep2</code>, .. etc.). The published versions of <code>dep1</code> are:</p>
  35. <pre><code>{
  36. &quot;dist-tags&quot;: { &quot;latest&quot;: &quot;1.2.2&quot; },
  37. &quot;versions&quot;: [
  38. &quot;1.2.2&quot;,
  39. &quot;1.2.1&quot;,
  40. &quot;1.2.0&quot;,
  41. &quot;1.1.2&quot;,
  42. &quot;1.1.1&quot;,
  43. &quot;1.0.0&quot;,
  44. &quot;0.4.1&quot;,
  45. &quot;0.4.0&quot;,
  46. &quot;0.2.0&quot;
  47. ]
  48. }</code></pre><h3 id="caret-dependencies">Caret Dependencies</h3>
  49. <p>If <code>app</code>&#39;s <code>package.json</code> contains:</p>
  50. <pre><code>&quot;dependencies&quot;: {
  51. &quot;dep1&quot;: &quot;^1.1.1&quot;
  52. }</code></pre><p>Then <code>npm update</code> will install <a href="mailto:%60dep1@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>
  53. <h3 id="tilde-dependencies">Tilde Dependencies</h3>
  54. <p>However, if <code>app</code>&#39;s <code>package.json</code> contains:</p>
  55. <pre><code>&quot;dependencies&quot;: {
  56. &quot;dep1&quot;: &quot;~1.1.1&quot;
  57. }</code></pre><p>In this case, running <code>npm update</code> will install <a href="mailto:%60dep1@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><del>1.1.1<code>, which is equivalent
  58. to</code>&gt;=1.1.1 &lt;1.2.0<code>. So the highest-sorting version that satisfies</code></del>1.1.1<code>is used,
  59. which is</code>1.1.2`.</p>
  60. <h3 id="caret-dependencies-below-1-0-0">Caret Dependencies below 1.0.0</h3>
  61. <p>Suppose <code>app</code> has a caret dependency on a version below <code>1.0.0</code>, for example:</p>
  62. <pre><code>&quot;dependencies&quot;: {
  63. &quot;dep1&quot;: &quot;^0.2.0&quot;
  64. }</code></pre><p><code>npm update</code> will install <a href="mailto:%60dep1@0.2.0">`dep1@0.2.0</a><code>, because there are no other
  65. versions which satisfy</code>^0.2.0`.</p>
  66. <p>If the dependence were on <code>^0.4.0</code>:</p>
  67. <pre><code>&quot;dependencies&quot;: {
  68. &quot;dep1&quot;: &quot;^0.4.0&quot;
  69. }</code></pre><p>Then <code>npm update</code> will install <a href="mailto:%60dep1@0.4.1">`dep1@0.4.1</a><code>, because that is the highest-sorting
  70. version that satisfies</code>^0.4.0<code>(</code>&gt;= 0.4.0 &lt;0.5.0`)</p>
  71. <h3 id="updating-globally-installed-packages">Updating Globally-Installed Packages</h3>
  72. <p><code>npm update -g</code> will apply the <code>update</code> action to each globally installed
  73. package that is <code>outdated</code> -- that is, has a version that is different from
  74. <code>latest</code>.</p>
  75. <p>NOTE: If a package has been upgraded to a version newer than <code>latest</code>, it will
  76. be <em>downgraded</em>.</p>
  77. <h2 id="see-also">SEE ALSO</h2>
  78. <ul>
  79. <li><a href="../cli/npm-install.html">npm-install(1)</a></li>
  80. <li><a href="../cli/npm-outdated.html">npm-outdated(1)</a></li>
  81. <li><a href="../cli/npm-shrinkwrap.html">npm-shrinkwrap(1)</a></li>
  82. <li><a href="../misc/npm-registry.html">npm-registry(7)</a></li>
  83. <li><a href="../files/npm-folders.html">npm-folders(5)</a></li>
  84. <li><a href="../cli/npm-ls.html">npm-ls(1)</a></li>
  85. </ul>
  86. </div>
  87. <table border=0 cellspacing=0 cellpadding=0 id=npmlogo>
  88. <tr><td style="width:180px;height:10px;background:rgb(237,127,127)" colspan=18>&nbsp;</td></tr>
  89. <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>
  90. <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>
  91. <tr><td style="width:10px;height:10px;background:#fff" rowspan=2>&nbsp;</td></tr>
  92. <tr><td style="width:10px;height:10px;background:#fff">&nbsp;</td></tr>
  93. <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>
  94. <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>
  95. </table>
  96. <p id="footer">npm-update &mdash; npm@6.4.1</p>