npm-outdated.1 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. .TH "NPM-OUTDATED" "1" "March 2026" "NPM@11.12.0" ""
  2. .SH "NAME"
  3. \fBnpm-outdated\fR - Check for outdated packages
  4. .SS "Synopsis"
  5. .P
  6. .RS 2
  7. .nf
  8. npm outdated \[lB]<package-spec> ...\[rB]
  9. .fi
  10. .RE
  11. .SS "Description"
  12. .P
  13. This command will check the registry to see if any (or, specific) installed packages are currently outdated.
  14. .P
  15. By default, only the direct dependencies of the root project and direct dependencies of your configured \fIworkspaces\fR are shown. Use \fB--all\fR to find all outdated meta-dependencies as well.
  16. .P
  17. In the output:
  18. .RS 0
  19. .IP \(bu 4
  20. \fBwanted\fR is the maximum version of the package that satisfies the semver range specified in \fBpackage.json\fR. If there's no available semver range (i.e. you're running \fBnpm outdated --global\fR, or the package isn't included in \fBpackage.json\fR), then \fBwanted\fR shows the currently-installed version.
  21. .IP \(bu 4
  22. \fBlatest\fR is the version of the package tagged as latest in the registry. Running \fBnpm publish\fR with no special configuration will publish the package with a dist-tag of \fBlatest\fR. This may or may not be the maximum version of the package, or the most-recently published version of the package, depending on how the package's developer manages the latest npm help dist-tag.
  23. .IP \(bu 4
  24. \fBlocation\fR is where in the physical tree the package is located.
  25. .IP \(bu 4
  26. \fBdepended by\fR shows which package depends on the displayed dependency
  27. .IP \(bu 4
  28. \fBpackage type\fR (when using \fB--long\fR / \fB-l\fR) tells you whether this package is a \fBdependency\fR or a dev/peer/optional dependency. Packages not included in \fBpackage.json\fR are always marked \fBdependencies\fR.
  29. .IP \(bu 4
  30. \fBhomepage\fR (when using \fB--long\fR / \fB-l\fR) is the \fBhomepage\fR value contained in the package's packument
  31. .IP \(bu 4
  32. \fBdepended by location\fR (when using \fB--long\fR / \fB-l\fR) shows location of the package that depends on the displayed dependency
  33. .IP \(bu 4
  34. Red means there's a newer version matching your semver requirements, so you should update now.
  35. .IP \(bu 4
  36. Yellow indicates that there's a newer version \fIabove\fR your semver requirements (usually new major, or new 0.x minor) so proceed with caution.
  37. .RE 0
  38. .SS "An example"
  39. .P
  40. .RS 2
  41. .nf
  42. $ npm outdated
  43. Package Current Wanted Latest Location Depended by
  44. glob 5.0.15 5.0.15 6.0.1 node_modules/glob dependent-package-name
  45. nothingness 0.0.3 git git node_modules/nothingness dependent-package-name
  46. npm 3.5.1 3.5.2 3.5.1 node_modules/npm dependent-package-name
  47. local-dev 0.0.3 linked linked local-dev dependent-package-name
  48. once 1.3.2 1.3.3 1.3.3 node_modules/once dependent-package-name
  49. .fi
  50. .RE
  51. .P
  52. With these \fBdependencies\fR:
  53. .P
  54. .RS 2
  55. .nf
  56. {
  57. "glob": "^5.0.15",
  58. "nothingness": "github:othiym23/nothingness#master",
  59. "npm": "^3.5.1",
  60. "once": "^1.3.1"
  61. }
  62. .fi
  63. .RE
  64. .P
  65. A few things to note:
  66. .RS 0
  67. .IP \(bu 4
  68. \fBglob\fR requires \fB^5\fR, which prevents npm from installing \fBglob@6\fR, which is outside the semver range.
  69. .IP \(bu 4
  70. Git dependencies will always be reinstalled, because of how they're specified. The installed committish might satisfy the dependency specifier (if it's something immutable, like a commit SHA), or it might not, so \fBnpm outdated\fR and \fBnpm update\fR have to fetch Git repos to check. This is why currently doing a reinstall of a Git dependency always forces a new clone and install.
  71. .IP \(bu 4
  72. \fBnpm@3.5.2\fR is marked as "wanted", but "latest" is \fBnpm@3.5.1\fR because npm uses dist-tags to manage its \fBlatest\fR and \fBnext\fR release channels. \fBnpm update\fR will install the \fInewest\fR version, but \fBnpm install npm\fR (with no semver range) will install whatever's tagged as \fBlatest\fR.
  73. .IP \(bu 4
  74. \fBonce\fR is just plain out of date. Reinstalling \fBnode_modules\fR from scratch or running \fBnpm update\fR will bring it up to spec.
  75. .RE 0
  76. .SS "Configuration"
  77. .SS "\fBall\fR"
  78. .RS 0
  79. .IP \(bu 4
  80. Default: false
  81. .IP \(bu 4
  82. Type: Boolean
  83. .RE 0
  84. .P
  85. When running \fBnpm outdated\fR and \fBnpm ls\fR, setting \fB--all\fR will show all outdated or installed packages, rather than only those directly depended upon by the current project.
  86. .SS "\fBjson\fR"
  87. .RS 0
  88. .IP \(bu 4
  89. Default: false
  90. .IP \(bu 4
  91. Type: Boolean
  92. .RE 0
  93. .P
  94. Whether or not to output JSON data, rather than the normal output.
  95. .RS 0
  96. .IP \(bu 4
  97. In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR.
  98. .RE 0
  99. .P
  100. Not supported by all npm commands.
  101. .SS "\fBlong\fR"
  102. .RS 0
  103. .IP \(bu 4
  104. Default: false
  105. .IP \(bu 4
  106. Type: Boolean
  107. .RE 0
  108. .P
  109. Show extended information in \fBls\fR, \fBsearch\fR, and \fBhelp-search\fR.
  110. .SS "\fBparseable\fR"
  111. .RS 0
  112. .IP \(bu 4
  113. Default: false
  114. .IP \(bu 4
  115. Type: Boolean
  116. .RE 0
  117. .P
  118. Output parseable results from commands that write to standard output. For \fBnpm search\fR, this will be tab-separated table format.
  119. .SS "\fBglobal\fR"
  120. .RS 0
  121. .IP \(bu 4
  122. Default: false
  123. .IP \(bu 4
  124. Type: Boolean
  125. .RE 0
  126. .P
  127. Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior.
  128. .RS 0
  129. .IP \(bu 4
  130. packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory.
  131. .IP \(bu 4
  132. bin files are linked to \fB{prefix}/bin\fR
  133. .IP \(bu 4
  134. man pages are linked to \fB{prefix}/share/man\fR
  135. .RE 0
  136. .SS "\fBworkspace\fR"
  137. .RS 0
  138. .IP \(bu 4
  139. Default:
  140. .IP \(bu 4
  141. Type: String (can be set multiple times)
  142. .RE 0
  143. .P
  144. Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option.
  145. .P
  146. Valid values for the \fBworkspace\fR config are either:
  147. .RS 0
  148. .IP \(bu 4
  149. Workspace names
  150. .IP \(bu 4
  151. Path to a workspace directory
  152. .IP \(bu 4
  153. Path to a parent workspace directory (will result in selecting all workspaces within that folder)
  154. .RE 0
  155. .P
  156. When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project.
  157. .P
  158. This value is not exported to the environment for child processes.
  159. .SS "\fBbefore\fR"
  160. .RS 0
  161. .IP \(bu 4
  162. Default: null
  163. .IP \(bu 4
  164. Type: null or Date
  165. .RE 0
  166. .P
  167. If passed to \fBnpm install\fR, will rebuild the npm tree such that only versions that were available \fBon or before\fR the given date are installed. If there are no versions available for the current set of dependencies, the command will error.
  168. .P
  169. If the requested version is a \fBdist-tag\fR and the given tag does not pass the \fB--before\fR filter, the most recent version less than or equal to that tag will be used. For example, \fBfoo@latest\fR might install \fBfoo@1.2\fR even though \fBlatest\fR is \fB2.0\fR.
  170. .P
  171. This config cannot be used with: \fBmin-release-age\fR
  172. .SS "\fBmin-release-age\fR"
  173. .RS 0
  174. .IP \(bu 4
  175. Default: null
  176. .IP \(bu 4
  177. Type: null or Number
  178. .RE 0
  179. .P
  180. If set, npm will build the npm tree such that only versions that were available more than the given number of days ago will be installed. If there are no versions available for the current set of dependencies, the command will error.
  181. .P
  182. This flag is a complement to \fBbefore\fR, which accepts an exact date instead of a relative number of days.
  183. .P
  184. This config cannot be used with: \fBbefore\fR
  185. .P
  186. This value is not exported to the environment for child processes.
  187. .SS "See Also"
  188. .RS 0
  189. .IP \(bu 4
  190. npm help "package spec"
  191. .IP \(bu 4
  192. npm help update
  193. .IP \(bu 4
  194. npm help dist-tag
  195. .IP \(bu 4
  196. npm help registry
  197. .IP \(bu 4
  198. npm help folders
  199. .IP \(bu 4
  200. npm help workspaces
  201. .RE 0