Created
February 28, 2023 06:55
-
-
Save junibrosas/7628add7f0d58fa4126c0fa6b4e10343 to your computer and use it in GitHub Desktop.
Run this script to install Node.js on the machine.
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 | |
# Check the latest version of NVM | |
curl https://github.com/nvm-sh/nvm/releases/latest | cut -d \/ -f 8 | cut -d \" -f 1 | |
# Run the install script | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh | bash | |
# Paste in this scripts into your .bashrc or .bash_profile | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" | |
# Install node and npm | |
nvm ls-remote | |
nvm install lts/hydrogen # Change the version according to your reference | |
nvm alias default lts/hydrogen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment