Introduction
fnm is a Node.js version manager that makes nvm feel slow. Built in Rust, fnm installs Node.js versions in seconds and switches between them instantly. It supports .node-version and .nvmrc files for automatic per-project switching, works on Linux, macOS, and Windows, and integrates with all major shells.
With over 25,000 GitHub stars, fnm has become the preferred Node.js version manager for developers who value speed. It is 40x faster than nvm for version switching and supports all the same workflows.
What fnm Does
fnm manages multiple Node.js installations on your machine. Each project can use a different Node.js version specified in .node-version or .nvmrc. fnm switches versions automatically when you cd into a project directory, and installs new versions from the official Node.js release channels.
Architecture Overview
[Shell Integration]
bash, zsh, fish, PowerShell
eval "$(fnm env --use-on-cd)"
|
[fnm CLI (Rust)]
Single binary, no deps
|
+-------+-------+
| |
[Version Mgmt] [Auto-Switch]
fnm install Reads .node-version
fnm use or .nvmrc on cd
fnm default Switches instantly
|
[Node.js Installations]
~/.local/share/fnm/node-versions/
v18.x.x/
v20.x.x/
v22.x.x/Self-Hosting & Configuration
# Shell setup (~/.zshrc or ~/.bashrc)
eval "$(fnm env --use-on-cd --shell zsh)"
# Common operations
fnm install --lts # Install latest LTS
fnm install 22 # Install Node 22.x
fnm use 20 # Switch to Node 20
fnm default 20 # Set default version
fnm list # List installed versions
fnm list-remote # List available versions
fnm uninstall 18 # Remove a version
# Per-project version
echo "20" > .node-version # fnm auto-switches on cd
# Or use .nvmrc for nvm compatibility
echo "v20.11.0" > .nvmrc
# Corepack support (pnpm, yarn)
fnm install 20
corepack enableKey Features
- 40x Faster Than nvm — Rust binary with instant version switching
- Cross-Platform — Linux, macOS, Windows (including PowerShell)
- Auto-Switch — reads .node-version or .nvmrc on directory change
- nvm Compatible — supports .nvmrc files for easy migration
- Shell Integration — bash, zsh, fish, and PowerShell
- No Dependencies — single static binary
- Corepack — works with corepack for pnpm/yarn version management
- Completions — shell completions for all commands
Comparison with Similar Tools
| Feature | fnm | nvm | Volta | n | asdf |
|---|---|---|---|---|---|
| Language | Rust | Shell script | Rust | Shell script | Shell + plugins |
| Speed | Very Fast | Slow | Fast | Moderate | Moderate |
| Windows | Yes | WSL only | Yes | No | WSL only |
| .nvmrc | Yes | Yes | No (package.json) | No | No (.tool-versions) |
| Auto-Switch | Yes (--use-on-cd) | Yes (slower) | Yes (auto) | No | Yes |
| Package Pinning | No | No | Yes (pin in package.json) | No | No |
| Multi-Tool | Node.js only | Node.js only | Node.js + tools | Node.js only | Any tool |
FAQ
Q: How do I migrate from nvm to fnm? A: Install fnm, remove nvm from your shell config, add fnm eval. Your existing .nvmrc files work with fnm. Run "fnm install" for each version you need.
Q: fnm vs Volta — which should I choose? A: fnm for nvm-compatible workflows (.nvmrc, explicit version switching). Volta for automatic toolchain pinning in package.json and team-wide consistency.
Q: Does fnm work with Corepack? A: Yes. After installing a Node.js version via fnm, run "corepack enable" to activate pnpm and yarn version management via Corepack.
Q: How does auto-switching work? A: Add "eval $(fnm env --use-on-cd)" to your shell config. When you cd into a directory with .node-version or .nvmrc, fnm automatically switches to that version.
Sources
- GitHub: https://github.com/Schniz/fnm
- Documentation: https://github.com/Schniz/fnm#readme
- Created by Gal Schlezinger
- License: GPL-3.0