Skip to content

fnm

fnm (Fast Node Manager) - A fast and simple Node.js version manager, built with Rust

Why Choose fnm?

fnm is a modern Node.js version manager with the following advantages:

  • 🚀 Extreme Performance - Built with Rust, extremely fast startup and execution
  • 🔄 Cross-Platform Support - Perfect support for macOS, Windows, Linux
  • 📦 Single File Installation - No complex configuration, download and use
  • 🎯 Automatic Version Switching - Automatically switch Node.js versions based on project
  • 📁 Version File Support - Supports .node-version and .nvmrc files
  • 🐚 Multi-Shell Support - Supports Bash, Zsh, Fish, PowerShell

Quick Start

Install fnm

bash
curl -fsSL https://fnm.vercel.app/install | bash
powershell
winget install Schniz.fnm
bash
brew install fnm

Configure Shell

bash
eval "$(fnm env --use-on-cd)"
bash
eval "$(fnm env --use-on-cd)"
bash
fnm env --use-on-c | source
powershell
fnm env --use-on-cd | Out-String | Invoke-Expression

Install Node.js

bash
# Install latest LTS version
fnm install --lts

# Install specific version
fnm install 20

# Use specific version
fnm use 20

Main Features

🔄 Automatic Version Switching

fnm can automatically switch Node.js versions based on .node-version or .nvmrc files in the project directory:

bash
# Create .node-version file in project root
echo "20" > .node-version

# Automatically switch version when entering directory
cd my-project
# Automatically uses Node.js 20.x

📦 Version Aliases

Set aliases for commonly used Node.js versions:

bash
# Set alias
fnm alias 20 default

# Use alias
fnm use default

🔧 Corepack Support

fnm natively supports Corepack, which can automatically enable Yarn and pnpm:

bash
fnm install 20 --corepack-enabled

Next Steps