Online package.json dependency updater

Paste a package.json file to compare its dependencies with the versions available from the npm registry. Choose the versions and ranges you want, then generate an updated file.

The tool can show releases across major versions. Review release notes and test your project before using the generated file.




Your package.json is processed in your browser and is not uploaded. Only package names are sent to this server to retrieve version information from the npm registry.

Your updated package.json

Review the generated file carefully before running npm install.


Updating npm dependencies from the command line

npm provides commands for checking, installing, and updating dependencies. The result depends on the version ranges in package.json and the package-lock.json file.

  • npm update: Updates installed dependencies to the newest versions allowed by their configured version ranges.
  • npm update <package-name>: Updates a specific package within the allowed version range.
  • npm outdated: Shows installed, wanted, and latest package versions.
  • npm install <package-name>@<version>: Installs a specific version of a dependency.
  • npm install: Installs dependencies according to package.json and package-lock.json.
  • npm-check-updates: Checks package.json for newer releases, including new major versions.

Before updating, check release notes for breaking changes and test the project with the new dependency versions.


npm update

npm update installs the highest versions that satisfy the version ranges declared by your project and its dependencies. For example, ^1.2.3 normally permits compatible releases below 2.0.0, while ~1.2.3 normally permits patch releases below 1.3.0.

By default, npm does not rewrite the version ranges of direct dependencies in package.json. Use npm update --save if you also want npm to update those saved values. Review the resulting package-lock.json changes before committing them.


npm outdated

npm outdated compares installed packages with the versions allowed by package.json and the latest versions published to the configured registry.

The output of npm outdated is typically structured as follows:


Package                Current   Wanted    Latest    Location

<package-name-1>       <version> <version> <version> <path>
<package-name-2>       <version> <version> <version> <path>
...
<package-name-n>       <version> <version> <version> <path>

Current is the installed version, Wanted is the highest version allowed by the configured range, and Latest is the package's latest dist-tag. If Wanted differs from Latest, reaching Latest may require changing the range in package.json.


npm-check-updates

npm-check-updates is a separate tool that checks package.json for newer releases, ignoring the currently declared version ranges by default. Run it without an update option to preview the available changes.

You can run it without a global installation using npx npm-check-updates. Use npx npm-check-updates -u to write the selected upgrades to package.json, then run npm install to install them and update package-lock.json.

Because the default target is the latest release, the proposed changes can include new major versions. Use --target minor or --target patch when you want to limit the update level.