It automatically changes node versions as you move between projects

NVM, the Node Version Manager, has been around almost as long as node itself (the first version was published about a year after Node was first released). It solved a really frustrating problem: different projects required different versions of node. Instead of downloading and installing a new binary from the internet every time you switched projects, nvm let you just nvm use 12
.
But in 2025 nvm has two big shortcomings:
Section titled: But in 2025 nvm has two big shortcomings:-
It’s slow. If you have nvm automatically run on your shell startup, I would wager that it’s accounting for the majority of your shell startup lag. You won’t realize how long it’s taking until you remove it.
-
It still requires you to know that you need to switch node versions
- nvm supports an .nvmrc file but that still requires you to run an
nvm
command (the rc file just specifies the correct version in that command for you).
- nvm supports an .nvmrc file but that still requires you to run an
Introducing: FNM
Section titled: Introducing: FNM- Shell startup for fnm is upwards of 50x faster than nvm. It is a difference you will notice immediately upon switching
- It automatically changes node versions to match any project that you
cd
into!- It looks for a node version declared in
.node-version
or.nvmrc
files, or theengines.node
field of apackage.json
file.
- It looks for a node version declared in
Reducing mental load
Section titled: Reducing mental loadfnm is another tool in your tool belt for shortening the list of things you have to think about to successfully run a web project:
- easy-install lets you not worry about which package manager is in use
- corepack lets you not worry about which version of that package manager is in use
- A package manager lets you not worry about which versions of all the dependencies are in use
lets you not worry about which node version is in usefnm
Configure FNM
Section titled: Configure FNM-
First delete nvm:
rm -rf ~/.nvm
- Remove all references to it from your
~/.zshrc
file
-
Run the fnm auto install script:
Terminal window curl -fsSL https://fnm.vercel.app/install | bash -
Configure fnm to run on shell startup:
Terminal window eval "$(fnm completions --shell zsh)"eval "$(fnm env --use-on-cd --shell zsh --version-file-strategy=recursive --resolve-engines --corepack-enabled)"- The first line enables cli autocomplete for fnm commands
- The second line activates several configuration options that aren’t on by default:
- Use On CD: Automatically switch node versions when you
cd
into a project based on the contents of.node-version
or.nvmrc
- Version File Strategy: Look in parent directories for a
.node-version
or.nvmrc
file to use - Resolve Engines: Also look in
engines.node
field of apackage.json
file for a node version to use - Corepack Enabled: Automatically enable corepack on every new version of node that is installed
- Use On CD: Automatically switch node versions when you
Basic FNM usage
Section titled: Basic FNM usage# List available Node.js versions to installfnm list-remote
# Install a specific Node.js versionfnm install 24
# Use a specific versionfnm use 24
# Set a default versionfnm default 24
# List installed versionsfnm list