npm-outdated
Check for outdated npm package dependencies
TLDR
Find packages that are outdated in a project
Find packages that are outdated regardless of the current project
SYNOPSIS
npm outdated [package_name]
PARAMETERS
[package_name]
Limit the check to a specific package. If omitted, all packages are checked.
--json
Output results as JSON.
--long
Show extended information, including the homepage and repository.
--parseable
Output parseable results instead of a human-readable table.
--global
Check globally installed packages instead of the current project.
--depth=n
Maximum depth to inspect dependencies. Defaults to 0, meaning only top-level dependencies are checked.
--all
Show all outdated packages, including those that are not direct dependencies of the current project.
DESCRIPTION
The `npm outdated` command is a crucial tool for managing dependencies in Node.js projects. It scans your project's `package.json` file and compares the installed versions of your npm packages with the latest versions available in the npm registry. This allows you to identify packages that are out of date and potentially vulnerable to security risks or missing bug fixes and new features. It provides information on the currently installed version, the wanted version (the maximum version allowed by your specified version range in `package.json`), and the latest available version. The output helps developers make informed decisions about which packages to update, ensuring project stability and security. The command can be run in a terminal within your project directory or a subdirectory. Running `npm update` after running `npm outdated` will attempt to update packages based on the `package.json` version ranges.
CAVEATS
The `npm outdated` command relies on the `package.json` and `package-lock.json` files. Inconsistencies between these files or errors in your version ranges can lead to inaccurate results. Also, outdated packages aren't necessarily vulnerable or broken; always assess the impact of updating before doing so.
UNDERSTANDING OUTPUT COLUMNS
The output table contains the following columns:
Package: The name of the package.
Current: The version of the package currently installed.
Wanted: The maximum version of the package that satisfies the range specified in package.json.
Latest: The most recent version of the package available on the registry.
Location: The location in the node_modules folder where the package is installed.
Type: The type of dependency (dependencies, devDependencies).