October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How Does fnm Work? A Guide to Node.js Version Switching

Fast Node Manager lets developers install multiple Node.js versions and select one manually or switch by project directory with shell integration.
Length3 min Posted Quest giverVGSources Team

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Here, “FNM” means Fast Node Manager (fnm), the command-line tool for managing Node.js versions. The acronym has other meanings too—for example, it is used for an international Federation of Neurogastroenterology and Motility meeting. In a Node.js development context, fnm keeps multiple Node.js versions available and configures your shell to run the version you select.

What fnm does—and what it does not do

fnm manages Node.js runtime versions. It is not npm: npm is a package manager, while fnm installs and selects the Node.js version that your shell will use. The official fnm project describes it as a Node.js version manager.

That distinction matters when projects expect different Node.js versions. With fnm, you can install more than one version and choose which one is active, rather than relying on a single system-wide installation.

How fnm connects a Node.js version to your shell

Installing fnm is only the first step. Your shell must be initialized so it can locate and use the Node.js version managed by fnm. The setup process has three parts:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Install fnm. The project documents installation options for supported operating systems and package managers.
  2. Initialize it in your shell. Configure the shell to evaluate output from fnm env. The exact initialization line depends on the shell you use; follow the official installation guide.
  3. Install and select Node.js versions. Use fnm commands to add versions and make one available to the current shell context.

The shell initialization is what connects fnm’s version selection to commands such as node. If fnm is installed but the shell has not been configured, managed versions may not be available as expected.

Install and switch Node.js versions manually

Once fnm is installed and initialized, use its commands from a terminal:

  • fnm install 20 installs a matching Node.js version from the 20 series.
  • fnm install --lts asks fnm to install the latest LTS release according to its documented command behavior.
  • fnm use 20 selects a version for the current shell context.
  • fnm list shows the versions installed through fnm.
  • fnm default manages the default version.

For example, after installing version 20, run fnm use 20 in the shell where you want to use it. This manual approach gives you direct control over the active version, but you need to select it when you move to a project that needs a different one.

How automatic switching works with project files

For a project-based workflow, add --use-on-cd to fnm’s shell initialization. With that option enabled, fnm can check for a version file when you change directories and switch to the specified Node.js version. The documented version-file options include .node-version and .nvmrc.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A project’s version file tells contributors which Node.js version to use. If the required version is not already installed, install it with fnm; the project documentation describes the version-selection workflow, but automatic directory switching should not be mistaken for a guarantee that every required version is already present.

The fnm command reference also describes resolving the engines.node field in package.json when automatic switching is enabled and no version file takes precedence. Check the current command reference for the applicable behavior and options.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Manual selection or automatic switching?

Workflow Setup Control Project version file
Manual: fnm use Initialize fnm in the shell, then select a version with a command. Explicit: you choose when to change the active version. Not required to select a version manually.
Automatic: --use-on-cd Initialize fnm with the directory-change option. fnm can switch when you enter a project directory. Use .node-version or .nvmrc to specify the project version; the command reference also documents engines.node resolution when no version file takes precedence.

Manual selection suits people who want to control each switch or do not maintain version files. Automatic switching reduces repeated manual commands when projects specify their Node.js version and the shell hook is configured.

What to check if switching does not work

  • The node command still uses an unexpected version: confirm that your shell startup configuration initializes fnm by evaluating fnm env.
  • Entering a project does not change versions: check that initialization includes --use-on-cd and that the directory contains a supported version file.
  • A project asks for a version you do not have: install the needed version with fnm install, then use the project’s version file or select it manually.
  • Your shell’s setup line differs from an example: initialization syntax varies by shell, so use the official installation instructions for your shell rather than copying a line intended for another one.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How To Create Custom Stickers & Shoutouts In Monster Hunter WildsMonster Hunter WildsBlog20min
  2. How to Get XL Gogoat in Pokemon Legends Z-A (An Extra-Large Gogoat)Pokemon Legends Z-ABlog20min
  3. How to Get Rotting Lightbringer in Diablo 4Diablo 4Blog17min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.