• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1---
2section: cli-commands
3title: npm-outdated
4description: Check for outdated packages
5---
6
7# npm-outdated(1)
8
9## Check for outdated packages
10
11### Synopsis
12
13```bash
14npm outdated [[<@scope>/]<pkg> ...]
15```
16
17### Description
18
19This command will check the registry to see if any (or, specific) installed
20packages are currently outdated.
21
22In the output:
23
24* `wanted` is the maximum version of the package that satisfies the semver
25  range specified in `package.json`. If there's no available semver range (i.e.
26  you're running `npm outdated --global`, or the package isn't included in
27  `package.json`), then `wanted` shows the currently-installed version.
28* `latest` is the version of the package tagged as latest in the registry.
29  Running `npm publish` with no special configuration will publish the package
30  with a dist-tag of `latest`. This may or may not be the maximum version of
31  the package, or the most-recently published version of the package, depending
32  on how the package's developer manages the latest [dist-tag](npm-dist-tag).
33* `location` is where in the dependency tree the package is located. Note that
34  `npm outdated` defaults to a depth of 0, so unless you override that, you'll
35  always be seeing only top-level dependencies that are outdated.
36* `package type` (when using `--long` / `-l`) tells you whether this package is
37  a `dependency` or a `devDependency`. Packages not included in `package.json`
38  are always marked `dependencies`.
39* `homepage` (when using `--long` / `-l`) is the `homepage` value contained in the package's `package.json`
40* Red means there's a newer version matching your semver requirements, so you should update now.
41* Yellow indicates that there's a newer version above your semver requirements (usually new major, or new 0.x minor) so proceed with caution.
42
43### An example
44
45```bash
46$ npm outdated
47Package      Current   Wanted   Latest  Location
48glob          5.0.15   5.0.15    6.0.1  test-outdated-output
49nothingness    0.0.3      git      git  test-outdated-output
50npm            3.5.1    3.5.2    3.5.1  test-outdated-output
51local-dev      0.0.3   linked   linked  test-outdated-output
52once           1.3.2    1.3.3    1.3.3  test-outdated-output
53```
54
55With these `dependencies`:
56```json
57{
58  "glob": "^5.0.15",
59  "nothingness": "github:othiym23/nothingness#master",
60  "npm": "^3.5.1",
61  "once": "^1.3.1"
62}
63```
64
65A few things to note:
66
67* `glob` requires `^5`, which prevents npm from installing `glob@6`, which is
68  outside the semver range.
69* Git dependencies will always be reinstalled, because of how they're specified.
70  The installed committish might satisfy the dependency specifier (if it's
71  something immutable, like a commit SHA), or it might not, so `npm outdated` and
72  `npm update` have to fetch Git repos to check. This is why currently doing a
73  reinstall of a Git dependency always forces a new clone and install.
74* `npm@3.5.2` is marked as "wanted", but "latest" is `npm@3.5.1` because npm
75  uses dist-tags to manage its `latest` and `next` release channels. `npm update`
76  will install the _newest_ version, but `npm install npm` (with no semver range)
77  will install whatever's tagged as `latest`.
78* `once` is just plain out of date. Reinstalling `node_modules` from scratch or
79  running `npm update` will bring it up to spec.
80
81### Configuration
82
83#### json
84
85* Default: false
86* Type: Boolean
87
88Show information in JSON format.
89
90#### long
91
92* Default: false
93* Type: Boolean
94
95Show extended information.
96
97#### parseable
98
99* Default: false
100* Type: Boolean
101
102Show parseable output instead of tree view.
103
104#### global
105
106* Default: false
107* Type: Boolean
108
109Check packages in the global install prefix instead of in the current
110project.
111
112#### depth
113
114* Default: 0
115* Type: Int
116
117Max depth for checking dependency tree.
118
119### See Also
120
121* [npm update](/cli-commands/npm-update)
122* [npm dist-tag](/cli-commands/npm-dist-tag)
123* [npm registry](/using-npm/registry)
124* [npm folders](/configuring-npm/folders)
125