update-search-sensitivity
@reggi/path-to-regexp
dependabot/npm_and_yarn/main/copy-to-clipboard-4.0.2
dependabot/npm_and_yarn/main/eslint-10.4.0
dependabot/npm_and_yarn/main/npmcli/eslint-config-7.0.0
dependabot/npm_and_yarn/main/proc-log-7.0.0
dependabot/npm_and_yarn/npm_and_yarn-826852524d
dependabot/npm_and_yarn/npm_and_yarn-ab9a7f4bc2
deprecate-totp-2fa
dhei/classic-tokens
gat-bypass-2fa-docs
jpg619/fix-accessibility-content-flow
jpg619/version-bump-tar-2
kartykp/gat-bypass-2fa-docs
kartykp/upgrade-path-to-regex
main
maitxn/version-bump-tar
patch-1
reggi/cache-based-on-version
reggi/dev-engines
reggi/fix-transform-prettier
reggi/overrides
update-search-sensitivity
| 1 | --- |
| 2 | title: npm-outdated |
| 3 | section: 1 |
| 4 | description: Check for outdated packages |
| 5 | github_repo: npm/cli |
| 6 | github_branch: release/v10 |
| 7 | github_path: docs/lib/content/commands/npm-outdated.md |
| 8 | redirect_from: |
| 9 | - /cli-documentation/v10/cli-commands/npm-outdated |
| 10 | - /cli-documentation/v10/cli-commands/outdated |
| 11 | - /cli-documentation/v10/commands/npm-outdated |
| 12 | - /cli-documentation/v10/commands/outdated |
| 13 | - /cli-documentation/v10/npm-outdated |
| 14 | - /cli-documentation/v10/outdated |
| 15 | - /cli/v10/cli-commands/npm-outdated |
| 16 | - /cli/v10/cli-commands/outdated |
| 17 | - /cli/v10/commands/outdated |
| 18 | - /cli/v10/npm-outdated |
| 19 | - /cli/v10/outdated |
| 20 | --- |
| 21 | |
| 22 | ### Synopsis |
| 23 | |
| 24 | ```bash |
| 25 | npm outdated [<package-spec> ...] |
| 26 | ``` |
| 27 | |
| 28 | ### Description |
| 29 | |
| 30 | This command will check the registry to see if any (or, specific) installed packages are currently outdated. |
| 31 | |
| 32 | By default, only the direct dependencies of the root project and direct dependencies of your configured _workspaces_ are shown. Use `--all` to find all outdated meta-dependencies as well. |
| 33 | |
| 34 | In the output: |
| 35 | |
| 36 | - `wanted` is the maximum version of the package that satisfies the semver range specified in `package.json`. If there's no available semver range (i.e. you're running `npm outdated --global`, or the package isn't included in `package.json`), then `wanted` shows the currently-installed version. |
| 37 | - `latest` is the version of the package tagged as latest in the registry. Running `npm publish` with no special configuration will publish the package with a dist-tag of `latest`. 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 [dist-tag](/cli/v10/commands/npm-dist-tag). |
| 38 | - `location` is where in the physical tree the package is located. |
| 39 | - `depended by` shows which package depends on the displayed dependency |
| 40 | - `package type` (when using `--long` / `-l`) tells you whether this package is a `dependency` or a dev/peer/optional dependency. Packages not included in `package.json` are always marked `dependencies`. |
| 41 | - `homepage` (when using `--long` / `-l`) is the `homepage` value contained in the package's packument |
| 42 | - Red means there's a newer version matching your semver requirements, so you should update now. |
| 43 | - Yellow indicates that there's a newer version _above_ your semver requirements (usually new major, or new 0.x minor) so proceed with caution. |
| 44 | |
| 45 | ### An example |
| 46 | |
| 47 | ```bash |
| 48 | $ npm outdated |
| 49 | Package Current Wanted Latest Location Depended by |
| 50 | glob 5.0.15 5.0.15 6.0.1 node_modules/glob dependent-package-name |
| 51 | nothingness 0.0.3 git git node_modules/nothingness dependent-package-name |
| 52 | npm 3.5.1 3.5.2 3.5.1 node_modules/npm dependent-package-name |
| 53 | local-dev 0.0.3 linked linked local-dev dependent-package-name |
| 54 | once 1.3.2 1.3.3 1.3.3 node_modules/once dependent-package-name |
| 55 | ``` |
| 56 | |
| 57 | With these `dependencies`: |
| 58 | |
| 59 | ```json |
| 60 | { |
| 61 | "glob": "^5.0.15", |
| 62 | "nothingness": "github:othiym23/nothingness#master", |
| 63 | "npm": "^3.5.1", |
| 64 | "once": "^1.3.1" |
| 65 | } |
| 66 | ``` |
| 67 | |
| 68 | A few things to note: |
| 69 | |
| 70 | - `glob` requires `^5`, which prevents npm from installing `glob@6`, which is outside the semver range. |
| 71 | - 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 `npm outdated` and `npm update` 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. |
| 72 | - `npm@3.5.2` is marked as "wanted", but "latest" is `npm@3.5.1` because npm uses dist-tags to manage its `latest` and `next` release channels. `npm update` will install the _newest_ version, but `npm install npm` (with no semver range) will install whatever's tagged as `latest`. |
| 73 | - `once` is just plain out of date. Reinstalling `node_modules` from scratch or running `npm update` will bring it up to spec. |
| 74 | |
| 75 | ### Configuration |
| 76 | |
| 77 | #### `all` |
| 78 | |
| 79 | - Default: false |
| 80 | - Type: Boolean |
| 81 | |
| 82 | When running `npm outdated` and `npm ls`, setting `--all` will show all outdated or installed packages, rather than only those directly depended upon by the current project. |
| 83 | |
| 84 | #### `json` |
| 85 | |
| 86 | - Default: false |
| 87 | - Type: Boolean |
| 88 | |
| 89 | Whether or not to output JSON data, rather than the normal output. |
| 90 | |
| 91 | - In `npm pkg set` it enables parsing set values with JSON.parse() before saving them to your `package.json`. |
| 92 | |
| 93 | Not supported by all npm commands. |
| 94 | |
| 95 | #### `long` |
| 96 | |
| 97 | - Default: false |
| 98 | - Type: Boolean |
| 99 | |
| 100 | Show extended information in `ls`, `search`, and `help-search`. |
| 101 | |
| 102 | #### `parseable` |
| 103 | |
| 104 | - Default: false |
| 105 | - Type: Boolean |
| 106 | |
| 107 | Output parseable results from commands that write to standard output. For `npm search`, this will be tab-separated table format. |
| 108 | |
| 109 | #### `global` |
| 110 | |
| 111 | - Default: false |
| 112 | - Type: Boolean |
| 113 | |
| 114 | Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See [folders](/cli/v10/configuring-npm/folders) for more on the differences in behavior. |
| 115 | |
| 116 | - packages are installed into the `{prefix}/lib/node_modules` folder, instead of the current working directory. |
| 117 | - bin files are linked to `{prefix}/bin` |
| 118 | - man pages are linked to `{prefix}/share/man` |
| 119 | |
| 120 | #### `workspace` |
| 121 | |
| 122 | - Default: |
| 123 | - Type: String (can be set multiple times) |
| 124 | |
| 125 | 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. |
| 126 | |
| 127 | Valid values for the `workspace` config are either: |
| 128 | |
| 129 | - Workspace names |
| 130 | - Path to a workspace directory |
| 131 | - Path to a parent workspace directory (will result in selecting all workspaces within that folder) |
| 132 | |
| 133 | When set for the `npm init` 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. |
| 134 | |
| 135 | This value is not exported to the environment for child processes. |
| 136 | |
| 137 | ### See Also |
| 138 | |
| 139 | - [package spec](/cli/v10/using-npm/package-spec) |
| 140 | - [npm update](/cli/v10/commands/npm-update) |
| 141 | - [npm dist-tag](/cli/v10/commands/npm-dist-tag) |
| 142 | - [npm registry](/cli/v10/using-npm/registry) |
| 143 | - [npm folders](/cli/v10/configuring-npm/folders) |
| 144 | - [npm workspaces](/cli/v10/using-npm/workspaces) |