nvm - Version manager for Node.js ChangeLog


# nvm
# ===
# Prerequisites:
# Git

# Set this environment variable pointing to ~/.nvm
export NVM_DIR="$HOME/.nvm"

# Get the source for the first time using Git
git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR"
cd "$NVM_DIR"
git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" \
$(git rev-list --tags --max-count=1)`

# If you already have it, do this to update it
cd "$NVM_DIR"
git fetch --tags origin
git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" \
$(git rev-list --tags --max-count=1)`

# Source it in to your current shell
. "$NVM_DIR/nvm.sh"

# Set it so this is done at login by updating ~/.profile
echo "export NVM_DIR=\"\$HOME/.nvm\"" >> ~/.profile
echo "[ -s \"\$NVM_DIR/nvm.sh\" ] && . \"\$NVM_DIR/nvm.sh\"" >> ~/.profile
echo "[ -s \"\$NVM_DIR/bash_completion\" ] &&" >> ~/.profile
echo " . \"\$NVM_DIR/bash_completion\"" >> ~/.profile

# Install Node.js, latest version
nvm install node

# List available versions
nvm ls-remote

# List installed versions
nvm ls

# Install Node.js, version 18.16.1
nvm install 18.16.1

# Install Node.js, version 16.20.1
nvm install 16.20.1

# Use a different version in the current shell
# (done automatically after installing)
nvm use 16.20.1

# Use Node.js version as the default in new shells
nvm alias default 16.20.1

# Display the path of the current version
nvm which current

# See help for other options
nvm --help

List of HOWTOs

Web page itself last updated: 2023-12-20 8:06pm (EDT -0400)
HOWTO last updated: 2023-07-17 10:48pm
Copyright © 2001-2024 Jason Englander. All Rights reserved.