Skip to content

Instantly share code, notes, and snippets.

@maxfi
Last active November 20, 2017 06:17
Show Gist options
  • Save maxfi/f04d8101d73d9f1e2d19f3ca66f05b73 to your computer and use it in GitHub Desktop.
Save maxfi/f04d8101d73d9f1e2d19f3ca66f05b73 to your computer and use it in GitHub Desktop.
[Install latest version of NVM]
echo "===> Current node version: $(node --version)"
echo "===> Current npm version: $(npm --version)"
echo "===> Installing/updating to latest version of NVM"
LATEST_NVM_VERSION=$(curl -s https://api.github.com/repos/creationix/nvm/releases/latest | grep '"tag_name":' | cut -d '"' -f 4)
curl -o- https://raw.githubusercontent.com/creationix/nvm/$LATEST_NVM_VERSION/install.sh | bash
# Enable NVM
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
echo "===> Installing and enabling latest LTS node release"
nvm install --lts
nvm alias default stable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment