The Best Version Manager For Node.js

nvm is definitely the most popular node version manager, but is it the best? Let's find out.

Star history

Number of GitHub stars for popular node version managers.

Recently, while setting up a new MacBook, I found myself — yet again — installing Node. Out of habit, I started typing nvm into Google to find its latest installation instructions. But then curiosity kicked in: Are there any other tools that do the same job? Maybe even something better?

After a bit of research, I discovered several tools worth considering:

I want to compare them against nvm!

nvm

nvm is the classic choice. It lets you install and switch between Node versions from the command line. It’s written in POSIX-compliant Bash and is widely adopted. Many repositories include a .nvmrc file to specify the Node version, and running nvm use automatically switches to that version.

However, it doesn’t automatically trigger version switching when entering a directory with a .nvmrc file, although user-contributed solutions exist.

It does the job well, and it's well recognized in the community.

Drawbacks:

  • No support for managing package manager versions.
  • No built-in way to automatically switch to the right version of Node in each project.

Volta

Volta calls itself a "hassle-free" JavaScript tool manager. It’s written in Rust and handles version management for Node and package managers. A standout feature is the pin command, which records the desired Node version in package.json. Volta then automatically ensures the correct version is used whenever you're in that project.

Instead of relying on shell hooks or OS-specific features, Volta uses shims to intercept and route tool executions to the appropriate version.

Drawbacks:

  • Limited pnpm support.
  • Does not support widely used .nvmrc file. It pins the versions in package.json (which is also a plus, at it doesn't require adding any extra files in the repository).

fnm

Another Node version manager written in Rust 🚀. fnm supports .nvmrc, making it a smooth transition for nvm users. It also offers automatic version switching when entering a project directory. Keeping it updated on macOS is as simple as brew upgrade fnm.

Drawbacks:

  • No package manager version management.
  • It offers fewer features than Volta, but it might be a good thing for some people 😉.

asdf

Unlike the previous tools, asdf is a version manager for multiple languages — Node.js, Ruby, Elixir, Erlang, and more. It supports both .nvmrc and its own .tool-versions file to configure versions across tools. It also includes a GitHub Action for easy CI/CD integration.

asdf has a plugin system for extending functionality. For example, to manage Node, you’ll need the asdf-nodejs plugin. It also supports extensions like asdf-direnv for directory-based environment loading.

Its functionality is also based on shims.

Drawbacks:

  • No package manager version management.
  • Adding plugins can be a bit manual — each may have setup requirements. Still, it’s worth the effort if you're managing more than just Node.

n

n is a straightforward version manager written in Bash. It supports both .nvmrc and its own .n-node-version file. It can also work with the engines field in package.json (though you’ll need node or jq installed to make that work).

Drawbacks:

  • No package manager version management.
  • No automatic version switching when entering a project directory.

Summary

For now, I’m giving Volta a try. Node support is all I need at the moment, and I appreciate that it handles package managers too.