# Automatically update all your global NodeJS packages

> To automatically update your global NodeJS packages just issue the following command. It will list outdated packages and update them via `npm install -g`.

- URL: https://graffino.com/til/automatically-update-all-your-global-nodejs-packages
- Author: Zeno Popovici
- Channel: command-line
- Published: 2021-11-12
- Updated: 2026-09-03

To automatically update your global NodeJS packages just issue the following command. It will list outdated packages and update them via `npm install -g`.


```bash
npm install -g $(npm outdated -g | cut -d' ' -f 1 | sed '1d' | xargs -I '$' echo '$@latest' | xargs echo)
```
