little cubes

FNM: a better node version manager

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:
  1. 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.

  2. 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).

fnm: The Fast Node Manager fixes both those problems:

  1. Shell startup for fnm is upwards of 50x faster than nvm. It is a difference you will notice immediately upon switching
  2. It automatically changes node versions to match any project that you cd into! mind-blown
    • It looks for a node version declared in .node-version or .nvmrc files, or the engines.node field of a package.json file.

fnm is another tool in your tool belt for shortening the list of things you have to think about to successfully run a web project:

  1. easy-install lets you not worry about which package manager is in use
  2. corepack lets you not worry about which version of that package manager is in use
  3. A package manager lets you not worry about which versions of all the dependencies are in use
  4. fnm lets you not worry about which node version is in use winning
  1. First delete nvm:

    1. rm -rf ~/.nvm
    2. Remove all references to it from your ~/.zshrc file
  2. Run the fnm auto install script:

    Terminal window
    curl -fsSL https://fnm.vercel.app/install | bash
  3. 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 a package.json file for a node version to use
      • Corepack Enabled: Automatically enable corepack on every new version of node that is installed
Terminal window
# List available Node.js versions to install
fnm list-remote
# Install a specific Node.js version
fnm install 24
# Use a specific version
fnm use 24
# Set a default version
fnm default 24
# List installed versions
fnm list