nvm
Files
SKILL.mdagentsreferences
Install
Install the containing plugin
/plugin install ci-cd@llm-skills
Invoke this skill after installation
/ci-cd:nvm
This skill is bundled inside ci-cd. Install the plugin once, then Claude Code can use any of its included skills. Browse the full plugin repository at github.com/alisonaquinas/llm-ci-dev.
SKILL.md
name: nvm description: Manage multiple Node.js versions with nvm. Use when tasks mention nvm, Node.js version switching, .nvmrc, or managing multiple Node versions per project.
nvm
Intent Router
| Request | Reference | Load When |
|---|---|---|
| Install nvm, shell profile integration, verify install | references/install-and-setup.md | nvm needs to be installed or the shell integration is not working |
| Install/use/alias/list/uninstall Node versions | references/command-cookbook.md | Specific nvm commands are needed |
| .nvmrc project file, default alias, auto-use on cd | references/nvmrc-and-defaults.md | Project-level Node version pinning is the topic |
| Lazy loading, fish shell, Windows alternatives | references/shell-integration.md | Shell startup performance or non-bash shells are the topic |
Quick Start
# Install Node.js LTS
nvm install --lts
# Use a specific version
nvm use 20
# Pin version for a project
echo "20" > .nvmrc
nvm use # reads .nvmrc automatically
# List installed versions
nvm ls
Core Command Tracks
- Install a version:
nvm install 20/nvm install --lts - Switch version:
nvm use 20/nvm use --lts - Set default:
nvm alias default 20 - List installed:
nvm ls - List available:
nvm ls-remote - Run with version:
nvm exec 18 node app.js - Remove a version:
nvm uninstall 16
Safety Guardrails
- Always commit
.nvmrcto version control so all team members use the same Node version. - Set
nvm alias default <version>after installing to ensure new shells use the correct version. - Never rely on the system node when nvm is active — use
nvm alias systemonly for explicit fallback. - In CI, install the version specified in
.nvmrcwithnvm installrather than hardcoding a version in the pipeline.
Workflow
- Install the desired Node.js version with
nvm install <version>. - Activate it with
nvm use <version>. - Set it as default with
nvm alias default <version>to persist across new shells. - Pin the project version by writing
<version>to.nvmrcand committing it. - In CI, run
nvm install(reads.nvmrc) followed bynvm use.
# Troubleshoot: nvm command not found in a new shell session
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm --version
Related Skills
- npm — Node.js package manager used alongside nvm
- yarn — alternative package manager for Node.js projects
- pnpm — disk-efficient Node.js package manager
- asdf — universal version manager that also handles Node.js
References
references/install-and-setup.mdreferences/command-cookbook.mdreferences/nvmrc-and-defaults.mdreferences/shell-integration.md- Official repo: https://github.com/nvm-sh/nvm
- Troubleshooting (macOS): https://github.com/nvm-sh/nvm#troubleshooting-on-macos
- Troubleshooting (Linux): https://github.com/nvm-sh/nvm#troubleshooting-on-linux