Update NPM packages to the latest version

To discover out of date packages run the following command:

npm outdated

It displays a list like this:

The "Wanted" column displays the latest safe version you can upgrade to and the "Latest" column displays the latest version available in the npm registry.

If you want to just update your dependencies to the latest safe version, use this command:

npm update

However, if you want to update to the latest major version, which might have breaking changes too, use the following command:

npm install <package1>@latest <package2>@latest <package3>@latest

If you want to update all the dependencies in one command, use the following tools:

npx npm-check-updates -u
npm install