Last active
November 20, 2017 06:17
-
-
Save maxfi/f04d8101d73d9f1e2d19f3ca66f05b73 to your computer and use it in GitHub Desktop.
[Install latest version of NVM]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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