Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajendarreddyj/262e8716ad73fd591042f2fe1c3eb8fe to your computer and use it in GitHub Desktop.
Save rajendarreddyj/262e8716ad73fd591042f2fe1c3eb8fe to your computer and use it in GitHub Desktop.
a safe way to upgrade all of your globally-installed npm packages
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
npm -g install "$package"
done
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f2)
do
npm -g install "$package"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment