nvm
๐ Star trend+296 / 31d
Summary
Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
๐ Highlights
nvm is a command-line tool for installing and managing multiple Node.js versions per-user and per-shell. It solves the problem of switching between different Node.js versions for different projects on Unix, macOS, and Windows WSL.
- Install and switch between Node.js versions via simple commands.
- Supports POSIX-compliant shells: bash, zsh, ksh, dash, sh.
- Per-user installation with automatic shell profile configuration.
- Use a .nvmrc file to auto-switch Node version per directory.
- Migrate global npm packages when installing a new Node version.
- Offline install and custom binary mirror support.
- Works on Linux, macOS, and Windows WSL.
๐ค AI Deep Analysis
nvm is the go-to Node.js version manager for Unix-like systems, offering simplicity and reliability, though alternatives may be faster or support Windows better.
โ Pros
- Simple and lightweight bash script
- POSIX-compliant, works on Unix-like systems
- Easy to install and use
- Supports .nvmrc for project-specific versions
- Active community and well-maintained
โ ๏ธ Cons
- Not available on Windows natively (requires WSL or similar)
- Slower than some alternatives like fnm or n
- Shell startup can be slower due to sourcing
- Limited to Node.js version management only
๐ฏ Use cases
- Managing multiple Node.js versions on development machines
- Testing applications across different Node.js versions
- CI/CD environments on Unix-like systems
- Quickly switching Node.js versions per project
โ๏ธ Comparison
Compared to fnm (Rust-based, faster, Windows support) and n (simpler, npm-based), nvm is more mature and widely adopted but slower and Unix-only. Volta offers automatic version switching but is heavier.