fnm

Fast and simple Node.js version manager, built in Rust — supports .nvmrc and .node-version files.

fnm (Fast Node Manager) is a Node.js version manager written in Rust. It is a much faster drop-in replacement for nvm, with support for the same .nvmrc and .node-version files, cross-platform compatibility, and automatic version switching when you enter a directory.

Features

  • Blazing fast — version switches happen in milliseconds compared to the seconds nvm can take, thanks to being a native Rust binary rather than a shell script
  • Automatic switching — detects .nvmrc or .node-version files and switches Node versions automatically as you cd between projects
  • Cross-platform — works on Linux, macOS, and Windows (including WSL)
  • Multiple shells — supports bash, zsh, fish, PowerShell, and more
  • .nvmrc compatible — works with existing version pin files without any changes
  • Aliases — create named aliases for versions (e.g. default, lts)
  • Single binary — no dependencies, no shell function startup overhead

Installation

cargo install fnm

Or via your system package manager:

# macOS
brew install fnm

# Windows (winget)
winget install Schniz.fnm

# Windows (scoop)
scoop install fnm

# Arch Linux (AUR)
paru -S fnm

# Debian / Fedora
# No official package; use the install script (works on all Linux distributions):
curl -fsSL https://fnm.vercel.app/install | bash

Setup

Add the init hook to your shell's config file:

# bash (~/.bashrc)
eval "$(fnm env --use-on-cd --shell bash)"

# zsh (~/.zshrc)
eval "$(fnm env --use-on-cd --shell zsh)"

# fish (~/.config/fish/config.fish)
fnm env --use-on-cd --shell fish | source

# PowerShell ($PROFILE)
fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression

The --use-on-cd flag enables automatic version switching when you enter a directory with a .nvmrc or .node-version file.

Usage

# Install the latest LTS release
fnm install --lts

# Install a specific version
fnm install 20.11.0

# Install the version specified in .nvmrc / .node-version
fnm install

# List installed versions
fnm list

# List all available versions for install
fnm list-remote

# Switch to a version in the current shell
fnm use 20

# Use the version specified in the current directory's pin file
fnm use

# Set a default version for new shells
fnm default 20

# Show the currently active version
fnm current

# Uninstall a version
fnm uninstall 18.19.0

Pin a version for a project

Create a .node-version (or .nvmrc) file in your project root:

echo "20.11.0" > .node-version

From then on, fnm will automatically switch to that version whenever you enter the directory (if you set up --use-on-cd) or when you run fnm use manually.

Why not nvm?

nvm is a shell script that is sourced into every new shell session, adding noticeable startup latency (often 200–500ms). fnm is a compiled binary that initialises in under a millisecond, making it invisible in your shell startup time while providing the same functionality.