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