๐Ÿ“ขgitzw.comไธŠ็บฟไบ†๏ผŒๅŠŸ่ƒฝ้™†็ปญๆ›ดๆ–ฐไธญ๏ผŒๅฆ‚ๆœ‰้—ฎ้ข˜ๆˆ–ๅ้ฆˆ่ฏทๅœจไธ‹ๆ–นๅ้ฆˆ/ๅปบ่ฎฎไธญ็ป™ๆˆ‘ไปฌ็•™่จ€ใ€‚
nvm-sh

nvm

nvm-sh/nvmShellโ˜… 94,183โ‘‚ 10,268
๐Ÿ“ˆ Star trend+296 / 31d
View on GitHub

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.