1. Update all globally installed packages to the wanted version:

We can list the outdated packages and their wanted versions:

npm outdated -g

To update a single pkg, use:

npm update -g <packagename>

To update all (to wanted version):

npm update -g
  1. Update to the latest version
npx npm-check --global --update-all

Read more: https://stackoverflow.com/questions/53238230/how-to-update-globally-installed-npm-packages