fnm(1)
fnm is a fast Node.js version manager that lets you install and switch between multiple Node.js versions without affecting system binaries.
Synopsis
fnm [COMMAND] [OPTIONS]Description
fnm (Fast Node Manager) is a cross-platform Node.js version manager written in Rust. It allows you to install multiple versions of Node.js and easily switch between them on a per-project or global basis. Unlike nvm, fnm is significantly faster and uses symlinks rather than PATH manipulation.
fnm stores Node.js versions in a local directory (typically ~/.fnm) and provides shell integration to automatically detect and use the correct version when entering a directory with a .nvmrc or .node-version file.
Common options
| Flag | What it does |
|---|---|
--version | Show fnm version number and exit |
--help | Display help information for fnm or a specific command |
--node-dist-mirror | Set custom mirror URL for downloading Node.js (default: nodejs.org) |
--fnm-dir | Set custom directory where Node.js versions are installed (default: ~/.fnm) |
--log-level | Set logging level: all, debug, info, warn, error, quiet |
--corepack-enabled | Enable or disable Corepack (pnpm, yarn, npm bundled with Node.js) |
--arch | Specify architecture for Node.js installation (x64, arm64, etc.) |
Examples
Install the latest version of Node.js available
fnm install --latestInstall a specific Node.js version (18.17.0)
fnm install 18.17.0Switch to the latest installed Node.js v18.x version
fnm use 18List all installed Node.js versions; current version marked with '*'
fnm listSet the global default Node.js version
fnm default 20.10.0Remove the specified Node.js version from disk
fnm uninstall 16.20.0Generate shell initialization code for bash with auto-switching support
fnm env --use-on-cd --shell bashRun a command using a specific Node.js version without permanently switching
fnm exec --using=18 npm install