Skip to content

Instantly share code, notes, and snippets.

@alokraj68
Last active August 28, 2022 05:23
Show Gist options
  • Select an option

  • Save alokraj68/2d705afe8acc05b15b775d97cb523dda to your computer and use it in GitHub Desktop.

Select an option

Save alokraj68/2d705afe8acc05b15b775d97cb523dda to your computer and use it in GitHub Desktop.
Nvm
#!/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"
@alokraj68
Copy link
Author

alokraj68 commented Aug 28, 2022

curl -o- https://gist.githubusercontent.com/alokraj68/2d705afe8acc05b15b775d97cb523dda/raw/1b15f3ef78c724fe1017ac22f19b77c5039451cc/intall-node.sh | bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment