I keep meaning to run this but always forget the flag. There’s no npm update-all or anything – it’s just:

npm update -g

The -g tells npm to operate on the global package registry instead of the local node_modules. Without it, npm update only touches packages listed in your project’s package.json, which is the default behaviour and what you want most of the time.

One thing to bear in mind: npm update won’t bump you to a new major version, even if one’s available. It respects the semver range in whatever pinned your package – so if you installed commander@2.x and 4.x is out, you’ll stay on 2.x. If you actually want to upgrade majors, you need to be explicit:

npm update -g <package-name>@latest

I tend to run the first command once a week as part of my morning routine, alongside brew upgrade and whatever else needs tidying.