n vs nvm
Which should you use? A side-by-side look at what each one does, who it suits, what it costs, how hard it is to set up, and where each falls short.
Open source · MIT
A simple command-line tool for downloading, switching, and removing Node.js versions on macOS and Linux.
Open source · MIT
A command-line tool to install and switch between multiple Node.js versions on Mac, Linux, and WSL.
The short answer
Choose n if you need…
- Developers who work on projects that need different Node.js versions
- People on macOS, Linux, or WSL who want a minimal tool without shell profile changes
- Users who prefer an interactive list to pick between installed versions
Choose nvm if you need…
- Developers who work on several Node.js projects that need different versions
- People on macOS, Linux, or Windows WSL who use a POSIX-compatible shell like bash or zsh
- Teams that pin a version in a .nvmrc file so everyone runs the same Node.js version
- Beginners who want a simple way to try a specific Node.js release
Side-by-side
| n | nvm | |
|---|---|---|
| Type | CLI | Dev tool |
| Price | Free and open source | Free and open source |
| Licence | MIT | MIT |
| GitHub stars | 19.5k | 95.7k |
| Setup difficulty | Beginner | Beginner |
| How you get it | Install with a package manager | Clone and build from source |
| Main language | Shell | Shell |
| Last code update | 19 days ago | 9 days ago |
What each one is
n
n is a command-line tool for installing and switching between different versions of Node.js. You run n with a version number like 20 or lts, and it downloads that version and makes it the active one. It keeps downloaded versions cached so you can switch back without downloading again.
nvm
nvm is a small shell script that lets you install several versions of Node.js on one computer and switch between them from the terminal. It is installed per user and loaded in each shell session. People use it when different projects need different Node.js versions.
Best for
n
- Developers who work on projects that need different Node.js versions
- People on macOS, Linux, or WSL who want a minimal tool without shell profile changes
- Users who prefer an interactive list to pick between installed versions
nvm
- Developers who work on several Node.js projects that need different versions
- People on macOS, Linux, or Windows WSL who use a POSIX-compatible shell like bash or zsh
- Teams that pin a version in a .nvmrc file so everyone runs the same Node.js version
- Beginners who want a simple way to try a specific Node.js release
Strengths
n
- Simple commands with no shell subshells or profile setup, according to the README
- Interactive selection of downloaded versions with arrow keys or j and k
- Reads version files like .nvmrc and .node-version for per-project versions
nvm
- Lets you keep several Node.js versions installed and switch between them quickly
- Works with common POSIX shells such as bash, zsh, dash, and ksh, per the README
- MIT licensed and widely used, with a large and active open-source community
Not ideal for
n
- Windows users running PowerShell or Git for Windows BASH, since the README says n does not work in those native shells
- Users who need a version manager that works across many languages, since n only manages Node.js
- Users who do not want to change file ownership or install paths, since the README notes permission issues may need a workaround
nvm
- Windows users running native PowerShell or cmd without WSL, since the README only describes unix, macOS, and WSL support
- People who only need one Node.js version and never switch, since a system install or a direct download may be simpler
- Environments that cannot run shell scripts or need a fixed, prebuilt binary without an installer step
Trade-offs
n
- Does not support native Windows shells such as PowerShell
- Requires permission changes or a custom N_PREFIX location if the default install directory is not writable
- The README is truncated, so some details such as the full command list were not available to verify
nvm
- It is a shell script rather than a native app, so behavior depends on your shell setup and profile files
- The README notes Windows support is through WSL, not native Windows
- Setup involves editing shell profile files, which can be confusing for beginners
Getting started
n
Install n with npm (requires an existing Node.js install)
npm install -g nInstall the latest LTS version of Node.js
n ltsnvm
Install or update nvm (cURL)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bashInstall or update nvm (Wget)
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bashFrequently asked questions
What is the difference between n and nvm?
n: A simple command-line tool for downloading, switching, and removing Node.js versions on macOS and Linux. nvm: A command-line tool to install and switch between multiple Node.js versions on Mac, Linux, and WSL. n suits developers who work on projects that need different node.js versions, while nvm suits developers who work on several node.js projects that need different versions.
Are n and nvm free?
n: Free and open source. nvm: Free and open source.
Is n or nvm more popular?
nvm has more GitHub stars (95.7k) than n (19.5k). Popularity isn't the same as fit — check which one matches your use case above.
What are other alternatives to n and nvm?
Other options people compare them with include asdf.
Keep comparing
Built from our catalogue entries for both products: open-source details come from each project's README (AI-assisted, refreshed weekly) and GitHub data; AI-tool details are editorial. Spotted something wrong? Let us know from either product's page.