Node.js update package.json to the latest versions of the dependencies

Using npx:

npx npm-check-updates -u
npm install

Using npm-check-updates package:

npm i -g npm-check-updates
ncu -u
npm install

Source