Fast Node Manager (fnm)
07. Apr. 2025
You can manage different versions of Node.js locally with the Node Version Manager (nvm). However, the Fast Node Manager (fnm) offers some advantages:
- Cross-platform support (i.e. for macOS, Windows, Linux)
- Easy installation
- Fast execution speed
- Works with
.node-versionand.nvmrcfiles
For installation details, see the Github Repo. Below I summarize the steps needed to install fnm for macOS.
Installation
Installation using Homebrew is the easiest. You only need to install one package:
brew install fnm
After that, the following line of code needs to be added to the .zprofile file (or .zshrc file):
eval "$(fnm env --use-on-cd --shell zsh)"
If oh my zsh is instalöed, you can also add a file (e.g. fnm_init.zsh) into the folder ~/.oh-my-zsh/custom/ containing:
# Initialite fnm environment
eval "$(fnm env --use-on-cd --shell zsh)"
Now the terminal environment has to be restarted and fnm is ready to use!
Usage
The following are probably the most important or most frequently used commands:
fnm list-remote: Returns a list of all available versions of Node.jsfnm list: Returns a list of all installed versions of Node.jsfnm install xxx: Installs the version of Node.js specified by xxxfnm use xxx: Changes the used version of Node.jsfnm env: Outputs the required environment variables forfnmfnm default xxx: Setsxxxas the default versionfnm current: Outputs the current versionfnm uninstall xxx: Deletes the version of Node.js specified byxxx