name: nvm-install description: "Install and update nvm (Node Version Manager) using curl/wget scripts, git clone, or manual methods. Covers profile selection, NVM_DIR configuration, and Alpine Linux support. Use when the user asks to install nvm, update nvm, set up nvm for the first time, or troubleshoot nvm installation scripts."
Install or upgrade nvm from the official source using script, git, or manual methods.
Identify platform and shell (macOS, Linux, WSL, Alpine; bash/zsh/fish).
Install via curl or wget:
# Using curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
# Using wget
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
Verify the profile was updated (the script writes to ~/.bashrc, ~/.zshrc, or ~/.profile):
# Required lines in your profile:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
Verify installation:
# Restart terminal, then:
nvm --version
Override PROFILE if the auto-detection picked the wrong file:
PROFILE=/path/to/custom/profile curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
Notes:
examples/installation.md - Standard installationexamples/install-update-script.md - Updating existing nvmexamples/install-additional-notes.md - Platform-specific notesexamples/git-install.md - Git-based installationexamples/manual-install.md - Manual installationexamples/manual-upgrade.md - Manual upgrade stepsexamples/alpine-install.md - Alpine Linux installationnvm install, install.sh, PROFILE, NVM_DIR, NVM_SOURCE, curl, wget, manual install, update