Skip to content

Instantly share code, notes, and snippets.

@mehmt948
Created May 1, 2023 13:46
Show Gist options
  • Save mehmt948/0ed552f0b41e253a167f5f7a93a31dd5 to your computer and use it in GitHub Desktop.
Save mehmt948/0ed552f0b41e253a167f5f7a93a31dd5 to your computer and use it in GitHub Desktop.
Install Node.js using nvm
#!/bin/bash
# Download and run the NVM installation script
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
# Reload the shell configuration to make the nvm command available
source ~/.bashrc
# Print instructions for listing versions of Node.js
echo "list versions -> 'nvm list-remote'"
# Print instructions for installing a specific version of Node.js
echo "install a version -> 'nvm install lts/hydrogen'"
# Print instructions for selecting a specific version of Node.js
echo "select a version -> 'nvm use lts/hydrogen'"
# Print instructions for setting the default version of Node.js
echo "select the default version -> 'nvm alias default 16.19.0'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment