Created
January 16, 2024 18:27
-
-
Save gnanet/5db1cca041f9f763f5c44e10fe2067de to your computer and use it in GitHub Desktop.
install latest nvm.sh dynamically always the latest
This file contains 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
#!/bin/bash | |
NVM_LATEST=$(curl https://api.github.com/repos/nvm-sh/nvm/releases/latest -s | grep "tag_name"| awk '{print substr($2, 2, length($2)-3) }') | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/${NVM_LATEST}/install.sh | bash | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
nvm install --lts node |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment