Description
Provides autocompletion and automatic loading for Node Version Manager, enabling easy switching between Node.js versions.
GitHub
Essential Commands
nvm install <version>
- Install specific Node.js versionnvm use <version>
- Switch to specific Node.js versionnvm ls
- List installed Node.js versionsnvm ls-remote
- List available versions for downloadnvm current
- Show currently active version
Advanced Commands
nvm install --lts
- Install latest LTS versionnvm alias default <version>
- Set default Node.js versionnvm uninstall <version>
- Remove installed versionnvm which <version>
- Show path to specific version
Configuration Options
# In .zshrc before oh-my-zsh
zstyle ':omz:plugins:nvm' lazy yes
zstyle ':omz:plugins:nvm' autoload yes
Usage Examples
# Version management
nvm install 18.17.0 # Install specific version
nvm install --lts # Install latest LTS
nvm use 16.20.0 # Switch to version
nvm alias default 18.17.0 # Set default
# Project-based versions
echo "18.17.0" > .nvmrc # Create version file
nvm use # Use version from .nvmrc