Skip to content

Instantly share code, notes, and snippets.

@thornbill
Created February 10, 2016 21:29
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 thornbill/4e9c761cc9c93f49a40c to your computer and use it in GitHub Desktop.
Save thornbill/4e9c761cc9c93f49a40c to your computer and use it in GitHub Desktop.
Bash function to update installed node.js versions in nvm
nvm_update() {
for NVM_UPDATE_VER in 0.10 0.12 4 5
do
# Install the latest versions of node only if they are already installed
nvm which $NVM_UPDATE_VER &>/dev/null && nvm install $NVM_UPDATE_VER
done
# Switch back to the default version of node
echo "Switching to default version of node..."
nvm use default
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment