nvm: Node.js version manager for POSIX shells
nvm is a per-user, per-shell version manager for Node.js that allows switching between multiple installed Node versions from the command line. It works on any POSIX-compliant shell across Unix, macOS, and Windows WSL environments.
Learn more about nvm
nvm is a version management tool for Node.js that operates as a set of shell functions loaded into POSIX-compliant shell environments rather than as a standalone executable. It works by dynamically modifying the shell's PATH environment variable to point to different Node.js installations stored in isolated directories within the user's home directory, enabling per-shell version switching without requiring system-level permissions. The tool supports automatic version detection through configuration files that specify which Node.js version a project requires, triggering the appropriate PATH manipulation when entering project directories. nvm maintains a local registry of available Node.js versions and downloads binary distributions on demand, storing each version in a separate subdirectory to prevent conflicts. This architecture allows multiple Node.js versions to coexist on a single system while maintaining complete isolation between installations, though the shell-function approach means it must be sourced into each shell session rather than being globally available as a system command.
POSIX-compliant implementation
Written as a bash script that works across any POSIX-compliant shell (sh, dash, ksh, zsh, bash) rather than being shell-specific, enabling consistent behavior across different Unix-like environments and shells.
Per-user installation model
Installs to the user's home directory (~/.nvm) without requiring system-wide permissions or administrative access, allowing multiple users on the same system to maintain independent Node version configurations.
.nvmrc file integration
Supports project-level version specification through .nvmrc files, with optional shell integration to automatically switch Node versions when entering directories, enabling version consistency across development teams.
// .nvmrc file in project root
// 16.9.1
// In your Node.js script, verify version matches
const { execSync } = require('child_process');
const fs = require('fs');
const requiredVersion = fs.readFileSync('.nvmrc', 'utf8').trim();
const currentVersion = process.version.slice(1);
if (!currentVersion.startsWith(requiredVersion)) {
console.error(`Expected Node ${requiredVersion}, got ${currentVersion}`);
process.exit(1);
}Fixes node version detection in nvm_install_latest_npm command; no breaking changes or new requirements.
- –Update to resolve incorrect node version parsing when installing the latest npm via nvm_install_latest_npm.
- –No action required unless you encountered npm installation failures in prior versions.
Maintenance release fixing corepack reinstall issues, npm v11 compatibility, and LTS alias validation errors.
- –Avoid reinstalling corepack when using `reinstall-packages` to prevent conflicts with Node.js bundled versions.
- –Expect stricter LTS name validation; invalid or non-lowercase LTS names now trigger explicit errors in install and alias commands.
Bug-fix release improving `nvm install -b` error handling and fixing shell compatibility issues with `set -e` and aliased commands.
- –Update scripts if you rely on `nvm install -b`: it now fails cleanly when no binary is available instead of falling back to source.
- –Review any custom `--save` usage or `tput` aliases, as quoting and conflict fixes may change behavior in edge cases.
See how people are using nvm
Top in Developer Tools
Related Repositories
Discover similar tools and frameworks used by developers
playwright-mcp
Accessibility tree-based browser automation for LLMs.
statsd
UDP/TCP metrics collector with pluggable backend support.
cadvisor
Daemon for monitoring container resource usage and metrics.
crush
LLM-powered coding agent with LSP and MCP integration.
git
Snapshot-based version control with distributed repository architecture.