Skip to main content
← Guides

Guide

fnm vs nvm vs Volta: Windows, Shell Setup, and Pins

Updated PkgPulse Team10 min read
0

fnm vs nvm vs Volta: compare Windows support, shell setup, .nvmrc files, package.json version pins, and CI consistency to choose a Node.js version manager.

Contents

TL;DR

Choose nvm for a POSIX-shell workflow that already uses .nvmrc. Choose fnm when native Windows support and .nvmrc or .node-version selection matter. Choose Volta for Node and package-manager pins in package.json. Volta's pnpm support is experimental and requires VOLTA_FEATURE_PNPM=1. Measure shell startup locally rather than relying on a universal switching-speed ratio.

Key Takeaways

  • nvm supports POSIX shells, including WSL, rather than native Windows shells.
  • fnm supports Windows, macOS and Linux, with shell initialization required.
  • fnm reads .nvmrc and .node-version; --use-on-cd enables directory-based switching.
  • Volta reads its volta configuration in package.json, not .nvmrc or .node-version.
  • Volta pnpm support is experimental, including documented limitations.
  • CI must install and configure the selected tool before project pins can take effect.

Why Node.js Version Management Matters

Node.js major versions ship frequently. Node 26 is Active LTS, Node 22 and 24 are Maintenance LTS, and Node 18 and 20 are past upstream support. Select a supported runtime that your application and hosting platform accept. Developers working across multiple repositories need to switch versions instantly without thinking about it.

The problems that version managers solve:

  • Version mismatch — "works on my machine, fails in CI" because CI has a different Node.js version
  • Monorepo complexity — multiple packages in one repo requiring different Node versions
  • Team onboarding — new developers need the correct runtime version immediately
  • CI consistency — ensure the same Node version in every environment

nvm: The Classic Choice

nvm (Node Version Manager) has been the standard tool since 2010. It's a shell script (bash/zsh) that manages multiple Node.js installations in ~/.nvm/versions/node/.

Installation

# Install via official script
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash

# nvm does not support Homebrew-managed installations.
# Use the upstream installer and shell setup.

# Add to ~/.zshrc or ~/.bashrc (auto-added by installer)
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

Basic Usage

# Install Node.js versions
nvm install 22        # Install Node 22 (LTS)
nvm install 20        # Install Node 20
nvm install --lts     # Install current LTS
nvm install node      # Install latest

# Switch versions
nvm use 22
nvm use 20.11.0       # Exact version
nvm use --lts

# Default version for new shells
nvm alias default 22

# List installed versions
nvm ls
nvm ls-remote         # List all available versions

# Run command with specific version without switching
nvm exec 18 node -e "console.log(process.version)"

# Project-level version with .nvmrc
echo "22" > .nvmrc
nvm use               # Reads .nvmrc and switches

Auto-Switch with .nvmrc

# Add to ~/.zshrc for auto-switching when entering a directory
autoload -U add-zsh-hook
load-nvmrc() {
  local node_version="$(nvm version)"
  local nvmrc_path="$(nvm_find_nvmrc)"

  if [ -n "$nvmrc_path" ]; then
    local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")

    if [ "$nvmrc_node_version" = "N/A" ]; then
      nvm install
    elif [ "$nvmrc_node_version" != "$node_version" ]; then
      nvm use
    fi
  elif [ "$node_version" != "$(nvm version default)" ]; then
    echo "Reverting to nvm default version"
    nvm use default
  fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc

The nvm Performance Problem

The cost of sourcing nvm.sh depends on the shell and configuration. Measure time zsh -i -c exit with and without the manager in a disposable shell configuration. The former fixed millisecond values were not backed by retained run output.

fnm: Fast Node Manager

fnm is written in Rust and designed to be a drop-in replacement for nvm — same .nvmrc file format, similar commands, but dramatically faster. It works natively on Windows, macOS, and Linux.

Installation

# macOS/Linux via script
curl -fsSL https://fnm.vercel.app/install | bash

# macOS via Homebrew
brew install fnm

# Windows via Winget
winget install Schniz.fnm

# Windows via Chocolatey
choco install fnm

# Shell setup (add to .zshrc / .bashrc / .profile)
eval "$(fnm env --use-on-cd --shell zsh)"

# For fish shell
fnm env --use-on-cd --shell fish | source

# For Windows PowerShell (profile.ps1)
fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression

Basic Usage

# Install Node.js versions
fnm install 22            # Install Node 22
fnm install --lts         # Install current LTS
fnm install 20.11.0       # Exact version

# Switch versions
fnm use 22
fnm use --lts
fnm use 20.11.0

# Default version
fnm default 22

# List versions
fnm list               # Installed versions
fnm list-remote        # Available versions

# Auto-detect from .nvmrc or .node-version
fnm use               # Reads .nvmrc, switches automatically

# Run command without switching
fnm exec --using=18 node --version

Speed Comparison

Compare fnm use and nvm use only after installing the same Node version in both. Measure shell startup separately from switching and downloads. Keep tool versions, shell configuration and cache conditions in the result. No speed ratio is claimed here.

.nvmrc / .node-version Support

# Both file formats work with fnm
echo "22" > .nvmrc           # nvm format
echo "v22.14.0" > .nvmrc     # Exact version
echo "lts/jod" > .nvmrc      # LTS codename

# .node-version (also supported by fnm; Volta uses package.json)
echo "22" > .node-version

# With --use-on-cd flag (set in shell setup above), switching is automatic
cd ~/projects/old-project    # Has .nvmrc: 18 → switches to Node 18
cd ~/projects/new-project    # Has .nvmrc: 22 → switches to Node 22

CI/CD Integration

# GitHub Actions without fnm: setup-node reads .nvmrc directly
- name: Setup Node.js from .nvmrc
  uses: actions/setup-node@v4
  with:
    node-version-file: ".nvmrc"  # Works with GitHub Actions natively

# Or use fnm directly in CI
- name: Install fnm
  run: curl -fsSL https://fnm.vercel.app/install | bash

- name: Install Node.js
  run: |
    export PATH="$HOME/.local/share/fnm:$PATH"
    eval "$(fnm env)"
    fnm install
    fnm use  # Reads the version file after installation
    node --version

Volta: Project-Pinned Versions in package.json

Volta takes a fundamentally different approach. Instead of switching the system Node.js version, it intercepts node, npm, yarn, and npx commands at the binary level and silently uses the version pinned in the nearest package.json. No .nvmrc file needed — versions live in package.json where everyone can see them.

Installation

# macOS/Linux
curl https://get.volta.sh | bash

# Windows
# Download installer from https://volta.sh

# No shell eval needed — Volta works via binary shimming in PATH

Project Setup — pin versions in package.json

# Pin Node.js version for this project
volta pin node@22
volta pin npm@10

# Or pin yarn
volta pin yarn@1

# This modifies package.json automatically:
{
  "name": "my-project",
  "version": "1.0.0",
  "volta": {
    "node": "22.14.0",
    "npm": "10.9.2"
  }
}
# Now EVERYONE who works in this directory automatically gets Node 22.14.0
# No .nvmrc, no `nvm use`, no manual setup
# Even in CI — if Volta is installed, it reads package.json and uses the right version

# Install a version without pinning
volta install node@20

# List installed versions
volta list

# Run command with specific version
volta run --node 18 node --version

How Volta's Binary Shims Work

# Volta creates shims in ~/.volta/bin/
which node    # → ~/.volta/bin/node (Volta shim, not the real binary)
which npm     # → ~/.volta/bin/npm (Volta shim)

# When you run `node`, Volta:
# 1. Looks for package.json with "volta.node" field in current + parent dirs
# 2. If found, transparently routes to that version
# 3. If not found, uses your global default
# This happens in milliseconds — no shell hooks, no delay

Global Tool Management

# Install global CLIs with a pinned Node version
volta install typescript
volta install vite
volta install prettier
# Install other npm-distributed CLIs by their documented package names.

# These tools are pinned to the Node version that was current when installed
# They always work, regardless of which project Node version is active

# Check what's installed globally
volta list

CI/CD with Volta

# GitHub Actions — Volta reads package.json automatically
- name: Install Volta
  run: curl https://get.volta.sh | bash

- name: Install dependencies
  run: |
    export VOLTA_HOME="$HOME/.volta"
    export PATH="$VOLTA_HOME/bin:$PATH"
    npm install  # Volta automatically uses the version from package.json

Feature Comparison

FeaturenvmfnmVolta
Written inShell scriptRustRust
Startup and switching costMeasure shell initializationMeasure shell initializationShims choose the configured tool
Windows native❌ (WSL needed)✅✅
macOS✅✅✅
Linux✅✅✅
.nvmrc support✅✅No built-in reader
.node-version support❌✅No built-in reader
package.json selectionNo Volta-style pinsCan resolve engines.node with its documented optionvolta pins
Auto-switch on cdManual setup✅ --use-on-cd✅ Automatic
Global tool pinningVia npm -gVia npm -g✅ Native
Shell setup required✅ (eval)✅ (eval)❌ (PATH only)
pnpm integrationSeparate package-manager setupSeparate package-manager setupExperimental

Performance Benchmarks

No reproducible timing artifact is available for the former Apple M2 comparison. Treat the timings as withdrawn. Run the same installed runtime, shell and commands repeatedly on your own machine if startup or switching latency affects the decision.

When to Use Each

Choose fnm if:

  • You want to retain .nvmrc files while changing shell integration
  • Windows support is needed in your team
  • You use .nvmrc files in your projects already
  • Raw speed matters (scripts, CI)

Choose Volta if:

  • You work across multiple repos with different Node.js versions frequently
  • You want to enforce version consistency without relying on .nvmrc being present
  • Your team has "works on my machine" Node version issues
  • You use global CLI tools and want them to always work regardless of project version
  • You're in a monorepo where different packages need different Node versions

Keep nvm if:

  • Every tutorial you follow uses it and you don't want divergence from docs
  • Your .zshrc lazy-loading already mitigates the startup overhead
  • You rarely switch Node versions and the speed difference doesn't matter

Use mise (honorable mention) if:

  • You also manage other runtimes (Python, Ruby, Go) and want one tool for all of them
  • mise supports .nvmrc, .node-version, and its own .mise.toml format

Ecosystem & Community

Use upstream release and issue histories to evaluate maintenance. Stars, downloads and installation-script requests do not establish installed market share or enterprise adoption. The earlier growth, majority-use and named-company claims lacked supporting evidence and are omitted.

For runtime and test selection, see the Node test-runner comparison.

Migration Guide

To migrate from nvm to fnm, remove the nvm sourcing lines from your shell configuration and add the fnm initialization for that shell. Run fnm install to install the version selected by the project's version file. Your existing .nvmrc files work unchanged. The command names are almost identical — fnm install instead of nvm install, fnm use instead of nvm use.

Migrating to Volta requires a different mental model shift. You're not replacing nvm's commands — you're changing how version management works. The key migration step is running volta pin node in each of your projects to add the version pins to package.json. Once done, you can remove .nvmrc files from those projects or leave them as fallbacks for developers not using Volta.

Common pitfall with Volta: global tools installed via npm after switching to Volta may have version conflicts. The fix is to reinstall global tools via volta install rather than npm install -g to ensure they get properly shimmed. Teams that discover this gotcha after switching often wish they had read the "global tool management" section of Volta's docs before migrating.

Final Verdict 2026

fnm is the pragmatic upgrade for nvm users. Install it, update shell initialization, and verify directory selection and global tools before removing nvm. For teams with Windows developers, it's not just faster — it's the difference between a working workflow and one that requires WSL as a prerequisite.

Volta is the right choice when you need hard guarantees about Node.js versions in production codebases. The package.json integration makes version requirements explicit, version-controlled, and automatically enforced without any developer action. For teams managing dozens of repositories with different Node.js requirements, this enforcement mechanism is worth the migration effort.

nvm remains completely valid if you're satisfied with its performance and your workflow doesn't include Windows developers. Its existing shell and version-file workflow can remain useful.

Methodology

Official documentation supports the platform, configuration and pinning discussion. No current shell-speed benchmark or market-share measurement is claimed.

Source notes

Related: Bun vs Deno 2 vs Node 22 for runtime comparisons, or tsx vs ts-node vs bun: Running TypeScript Directly for TypeScript execution options.

For broader tooling context, see best JavaScript package managers 2026 and best monorepo tools 2026.

Team Standardization

Node version managers work best when the entire team uses the same tool. Mixing fnm and nvm on the same project creates invisible friction — .nvmrc files that not everyone respects, version mismatch errors that only appear on certain machines, and CI configurations that differ from local environments.

The .nvmrc / .node-version file is the shared contract. Both fnm and nvm read .nvmrc. Volta selects versions from the volta field in package.json; engines.node alone does not pin its runtime. Set one of these files at the repo root and enforce it in CI by running the version manager's install command as part of setup.

CI consistency matters more than local speed. Most CI systems (GitHub Actions, CircleCI, GitLab CI) pin Node versions via actions/setup-node or system package managers, not version managers. Make sure your CI Node version matches what's in your .nvmrc. A team can have fast local installs with fnm and deterministic CI setup with actions/setup-node — they're not mutually exclusive.

Windows support is the tiebreaker for many teams. fnm supports Windows natively. nvm requires nvm-windows, which is a separate project with different behavior. If any team member is on Windows, fnm is the safer choice for guaranteed consistent behavior. Volta also works cross-platform and pins npm or supported Yarn versions. Its pnpm integration requires an experimental feature flag.

The practical recommendation: migrate to fnm for new projects; use Volta if you want package.json-driven version pinning across Node, npm, and yarn as a single source of truth. Either way, standardize the entire team on one tool and document the choice in your project's contributing guide to prevent version drift from sneaking back in.