Last active
August 28, 2022 05:23
-
-
Save alokraj68/2d705afe8acc05b15b775d97cb523dda to your computer and use it in GitHub Desktop.
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
| #!/bin/sh | |
| # Install node and npm via nvm - https://github.com/nvm-sh/nvm | |
| # Run this script like - bash script-name.sh | |
| # Install nvm | |
| curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v$INSTALL_NVM_VER/install.sh | bash | |
| # Make nvm command available to terminal | |
| source ~/.nvm/nvm.sh | |
| echo "==> Installing node js version $INSTALL_NODE_VER" | |
| nvm install --lts | |
| echo "==> Make this version system default" | |
| nvm alias default --lts | |
| nvm use --lts | |
| echo "==> Checking for versions" | |
| nvm --version | |
| node --version | |
| npm --version | |
| echo "==> Print binary paths" | |
| which npm | |
| which node | |
| echo "==> List installed node versions" | |
| nvm ls | |
| nvm cache clear | |
| echo "==> Please Logout and Login back to take changes effect" | |
| echo "https://github.com/nvm-sh/nvm" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl -o- https://gist.githubusercontent.com/alokraj68/2d705afe8acc05b15b775d97cb523dda/raw/1b15f3ef78c724fe1017ac22f19b77c5039451cc/intall-node.sh | bash