Skip to content

Instantly share code, notes, and snippets.

@crazyoptimist
Last active March 28, 2024 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crazyoptimist/e003588c2c667ea0fb6b81bba34b662e to your computer and use it in GitHub Desktop.
Save crazyoptimist/e003588c2c667ea0fb6b81bba34b662e to your computer and use it in GitHub Desktop.
Install the latest version of nvm, node, npm
#!/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.39.5/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/iron # Change the version according to your reference
# nvm alias default v20.11.8
@crazyoptimist
Copy link
Author

This script will install nvm and node latest lts version on your nix OS real quick!

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