npm-outdated.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. <html><head>
  2. <title>npm-outdated</title>
  3. <style>
  4. body {
  5. background-color: #ffffff;
  6. color: #24292e;
  7. margin: 0;
  8. line-height: 1.5;
  9. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  10. }
  11. #rainbar {
  12. height: 10px;
  13. background-image: linear-gradient(139deg, #fb8817, #ff4b01, #c12127, #e02aff);
  14. }
  15. a {
  16. text-decoration: none;
  17. color: #0366d6;
  18. }
  19. a:hover {
  20. text-decoration: underline;
  21. }
  22. pre {
  23. margin: 1em 0px;
  24. padding: 1em;
  25. border: solid 1px #e1e4e8;
  26. border-radius: 6px;
  27. display: block;
  28. overflow: auto;
  29. white-space: pre;
  30. background-color: #f6f8fa;
  31. color: #393a34;
  32. }
  33. code {
  34. font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
  35. font-size: 85%;
  36. padding: 0.2em 0.4em;
  37. background-color: #f6f8fa;
  38. color: #393a34;
  39. }
  40. pre > code {
  41. padding: 0;
  42. background-color: inherit;
  43. color: inherit;
  44. }
  45. h1, h2, h3 {
  46. font-weight: 600;
  47. }
  48. #logobar {
  49. background-color: #333333;
  50. margin: 0 auto;
  51. padding: 1em 4em;
  52. }
  53. #logobar .logo {
  54. float: left;
  55. }
  56. #logobar .title {
  57. font-weight: 600;
  58. color: #dddddd;
  59. float: left;
  60. margin: 5px 0 0 1em;
  61. }
  62. #logobar:after {
  63. content: "";
  64. display: block;
  65. clear: both;
  66. }
  67. #content {
  68. margin: 0 auto;
  69. padding: 0 4em;
  70. }
  71. #table_of_contents > h2 {
  72. font-size: 1.17em;
  73. }
  74. #table_of_contents ul:first-child {
  75. border: solid 1px #e1e4e8;
  76. border-radius: 6px;
  77. padding: 1em;
  78. background-color: #f6f8fa;
  79. color: #393a34;
  80. }
  81. #table_of_contents ul {
  82. list-style-type: none;
  83. padding-left: 1.5em;
  84. }
  85. #table_of_contents li {
  86. font-size: 0.9em;
  87. }
  88. #table_of_contents li a {
  89. color: #000000;
  90. }
  91. header.title {
  92. border-bottom: solid 1px #e1e4e8;
  93. }
  94. header.title > h1 {
  95. margin-bottom: 0.25em;
  96. }
  97. header.title > .description {
  98. display: block;
  99. margin-bottom: 0.5em;
  100. line-height: 1;
  101. }
  102. footer#edit {
  103. border-top: solid 1px #e1e4e8;
  104. margin: 3em 0 4em 0;
  105. padding-top: 2em;
  106. }
  107. </style>
  108. </head>
  109. <body>
  110. <div id="banner">
  111. <div id="rainbar"></div>
  112. <div id="logobar">
  113. <svg class="logo" role="img" height="32" width="32" viewBox="0 0 700 700">
  114. <polygon fill="#cb0000" points="0,700 700,700 700,0 0,0"></polygon>
  115. <polygon fill="#ffffff" points="150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150"></polygon>
  116. </svg>
  117. <div class="title">
  118. npm command-line interface
  119. </div>
  120. </div>
  121. </div>
  122. <section id="content">
  123. <header class="title">
  124. <h1 id="npm-outdated">npm-outdated</h1>
  125. <span class="description">Check for outdated packages</span>
  126. </header>
  127. <section id="table_of_contents">
  128. <h2 id="table-of-contents">Table of contents</h2>
  129. <div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#an-example">An example</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#all"><code>all</code></a></li><li><a href="#json"><code>json</code></a></li><li><a href="#long"><code>long</code></a></li><li><a href="#parseable"><code>parseable</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#workspace"><code>workspace</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
  130. </section>
  131. <div id="_content"><h3 id="synopsis">Synopsis</h3>
  132. <pre lang="bash"><code>npm outdated [[&lt;@scope&gt;/]&lt;pkg&gt; ...]
  133. </code></pre>
  134. <h3 id="description">Description</h3>
  135. <p>This command will check the registry to see if any (or, specific) installed
  136. packages are currently outdated.</p>
  137. <p>By default, only the direct dependencies of the root project and direct
  138. dependencies of your configured <em>workspaces</em> are shown.
  139. Use <code>--all</code> to find all outdated meta-dependencies as well.</p>
  140. <p>In the output:</p>
  141. <ul>
  142. <li><code>wanted</code> is the maximum version of the package that satisfies the semver
  143. range specified in <code>package.json</code>. If there’s no available semver range
  144. (i.e. you’re running <code>npm outdated --global</code>, or the package isn’t
  145. included in <code>package.json</code>), then <code>wanted</code> shows the currently-installed
  146. version.</li>
  147. <li><code>latest</code> is the version of the package tagged as latest in the registry.
  148. Running <code>npm publish</code> with no special configuration will publish the
  149. package with a dist-tag of <code>latest</code>. This may or may not be the maximum
  150. version of the package, or the most-recently published version of the
  151. package, depending on how the package’s developer manages the latest
  152. <a href="../commands/npm-dist-tag.html">dist-tag</a>.</li>
  153. <li><code>location</code> is where in the physical tree the package is located.</li>
  154. <li><code>depended by</code> shows which package depends on the displayed dependency</li>
  155. <li><code>package type</code> (when using <code>--long</code> / <code>-l</code>) tells you whether this
  156. package is a <code>dependency</code> or a dev/peer/optional dependency. Packages not
  157. included in <code>package.json</code> are always marked <code>dependencies</code>.</li>
  158. <li><code>homepage</code> (when using <code>--long</code> / <code>-l</code>) is the <code>homepage</code> value contained
  159. in the package’s packument</li>
  160. <li>Red means there’s a newer version matching your semver requirements, so
  161. you should update now.</li>
  162. <li>Yellow indicates that there’s a newer version <em>above</em> your semver
  163. requirements (usually new major, or new 0.x minor) so proceed with
  164. caution.</li>
  165. </ul>
  166. <h3 id="an-example">An example</h3>
  167. <pre lang="bash"><code>$ npm outdated
  168. Package Current Wanted Latest Location Depended by
  169. glob 5.0.15 5.0.15 6.0.1 node_modules/glob dependent-package-name
  170. nothingness 0.0.3 git git node_modules/nothingness dependent-package-name
  171. npm 3.5.1 3.5.2 3.5.1 node_modules/npm dependent-package-name
  172. local-dev 0.0.3 linked linked local-dev dependent-package-name
  173. once 1.3.2 1.3.3 1.3.3 node_modules/once dependent-package-name
  174. </code></pre>
  175. <p>With these <code>dependencies</code>:</p>
  176. <pre lang="json"><code>{
  177. "glob": "^5.0.15",
  178. "nothingness": "github:othiym23/nothingness#master",
  179. "npm": "^3.5.1",
  180. "once": "^1.3.1"
  181. }
  182. </code></pre>
  183. <p>A few things to note:</p>
  184. <ul>
  185. <li><code>glob</code> requires <code>^5</code>, which prevents npm from installing <code>glob@6</code>, which
  186. is outside the semver range.</li>
  187. <li>Git dependencies will always be reinstalled, because of how they’re
  188. specified. The installed committish might satisfy the dependency
  189. specifier (if it’s something immutable, like a commit SHA), or it might
  190. not, so <code>npm outdated</code> and <code>npm update</code> have to fetch Git repos to check.
  191. This is why currently doing a reinstall of a Git dependency always forces
  192. a new clone and install.</li>
  193. <li><code>npm@3.5.2</code> is marked as “wanted”, but “latest” is <code>npm@3.5.1</code> because
  194. npm uses dist-tags to manage its <code>latest</code> and <code>next</code> release channels.
  195. <code>npm update</code> will install the <em>newest</em> version, but <code>npm install npm</code>
  196. (with no semver range) will install whatever’s tagged as <code>latest</code>.</li>
  197. <li><code>once</code> is just plain out of date. Reinstalling <code>node_modules</code> from
  198. scratch or running <code>npm update</code> will bring it up to spec.</li>
  199. </ul>
  200. <h3 id="configuration">Configuration</h3>
  201. <!-- raw HTML omitted -->
  202. <!-- raw HTML omitted -->
  203. <!-- raw HTML omitted -->
  204. <h4 id="all"><code>all</code></h4>
  205. <ul>
  206. <li>Default: false</li>
  207. <li>Type: Boolean</li>
  208. </ul>
  209. <p>When running <code>npm outdated</code> and <code>npm ls</code>, setting <code>--all</code> will show all
  210. outdated or installed packages, rather than only those directly depended
  211. upon by the current project.</p>
  212. <!-- raw HTML omitted -->
  213. <!-- raw HTML omitted -->
  214. <h4 id="json"><code>json</code></h4>
  215. <ul>
  216. <li>Default: false</li>
  217. <li>Type: Boolean</li>
  218. </ul>
  219. <p>Whether or not to output JSON data, rather than the normal output.</p>
  220. <ul>
  221. <li>In <code>npm pkg set</code> it enables parsing set values with JSON.parse() before
  222. saving them to your <code>package.json</code>.</li>
  223. </ul>
  224. <p>Not supported by all npm commands.</p>
  225. <!-- raw HTML omitted -->
  226. <!-- raw HTML omitted -->
  227. <h4 id="long"><code>long</code></h4>
  228. <ul>
  229. <li>Default: false</li>
  230. <li>Type: Boolean</li>
  231. </ul>
  232. <p>Show extended information in <code>ls</code>, <code>search</code>, and <code>help-search</code>.</p>
  233. <!-- raw HTML omitted -->
  234. <!-- raw HTML omitted -->
  235. <h4 id="parseable"><code>parseable</code></h4>
  236. <ul>
  237. <li>Default: false</li>
  238. <li>Type: Boolean</li>
  239. </ul>
  240. <p>Output parseable results from commands that write to standard output. For
  241. <code>npm search</code>, this will be tab-separated table format.</p>
  242. <!-- raw HTML omitted -->
  243. <!-- raw HTML omitted -->
  244. <h4 id="global"><code>global</code></h4>
  245. <ul>
  246. <li>Default: false</li>
  247. <li>Type: Boolean</li>
  248. </ul>
  249. <p>Operates in “global” mode, so that packages are installed into the <code>prefix</code>
  250. folder instead of the current working directory. See
  251. <a href="../configuring-npm/folders.html">folders</a> for more on the differences in behavior.</p>
  252. <ul>
  253. <li>packages are installed into the <code>{prefix}/lib/node_modules</code> folder, instead
  254. of the current working directory.</li>
  255. <li>bin files are linked to <code>{prefix}/bin</code></li>
  256. <li>man pages are linked to <code>{prefix}/share/man</code></li>
  257. </ul>
  258. <!-- raw HTML omitted -->
  259. <!-- raw HTML omitted -->
  260. <h4 id="workspace"><code>workspace</code></h4>
  261. <ul>
  262. <li>Default:</li>
  263. <li>Type: String (can be set multiple times)</li>
  264. </ul>
  265. <p>Enable running a command in the context of the configured workspaces of the
  266. current project while filtering by running only the workspaces defined by
  267. this configuration option.</p>
  268. <p>Valid values for the <code>workspace</code> config are either:</p>
  269. <ul>
  270. <li>Workspace names</li>
  271. <li>Path to a workspace directory</li>
  272. <li>Path to a parent workspace directory (will result in selecting all
  273. workspaces within that folder)</li>
  274. </ul>
  275. <p>When set for the <code>npm init</code> command, this may be set to the folder of a
  276. workspace which does not yet exist, to create the folder and set it up as a
  277. brand new workspace within the project.</p>
  278. <p>This value is not exported to the environment for child processes.</p>
  279. <!-- raw HTML omitted -->
  280. <!-- raw HTML omitted -->
  281. <!-- raw HTML omitted -->
  282. <h3 id="see-also">See Also</h3>
  283. <ul>
  284. <li><a href="../commands/npm-update.html">npm update</a></li>
  285. <li><a href="../commands/npm-dist-tag.html">npm dist-tag</a></li>
  286. <li><a href="../using-npm/registry.html">npm registry</a></li>
  287. <li><a href="../configuring-npm/folders.html">npm folders</a></li>
  288. <li><a href="../using-npm/workspaces.html">npm workspaces</a></li>
  289. </ul>
  290. </div>
  291. <footer id="edit">
  292. <a href="https://github.com/npm/cli/edit/latest/docs/content/commands/npm-outdated.md">
  293. <svg role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentcolor" style="vertical-align: text-bottom; margin-right: 0.3em;">
  294. <path fill-rule="evenodd" d="M11.013 1.427a1.75 1.75 0 012.474 0l1.086 1.086a1.75 1.75 0 010 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 01-.927-.928l.929-3.25a1.75 1.75 0 01.445-.758l8.61-8.61zm1.414 1.06a.25.25 0 00-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 000-.354l-1.086-1.086zM11.189 6.25L9.75 4.81l-6.286 6.287a.25.25 0 00-.064.108l-.558 1.953 1.953-.558a.249.249 0 00.108-.064l6.286-6.286z"></path>
  295. </svg>
  296. Edit this page on GitHub
  297. </a>
  298. </footer>
  299. </section>
  300. </body></html>