fnm Fast Node manager
Light · Postcard
102 × 152 mm · PDF
Dark · Postcard
102 × 152 mm · PDF
Ink saver · Postcard
102 × 152 mm · PDF
Light · A4 landscape
297 × 210 mm · PDF
Dark · A4 landscape
297 × 210 mm · PDF
Ink saver · A4 landscape
297 × 210 mm · PDF
Light · A3 landscape
420 × 297 mm · PDF
Dark · A3 landscape
420 × 297 mm · PDF
Ink saver · A3 landscape
420 × 297 mm · PDF
Start here
fnm install --lts
fnm listfnm use <version>
fnm default <version>
fnm currentfnm env --use-on-cd --shell bash
node --version > .node-version
fnm exec --using <version> <cmd>
Concepts
- .node-version version in project
- fnm env hook in your shell profile
- Shell PATH per-shell symlink
- Node version in ~/.local/share/fnm
Install fnm
curl -fsSL https://fnm.vercel.app/install | bash
brew install fnm
fnm --versionfnm completions --shell <shell>
Shell setup
eval "$(fnm env --use-on-cd --shell bash)"
eval "$(fnm env --use-on-cd --shell zsh)"
fnm env --use-on-cd --shell fish | source
fnm env --version-file-strategy recursive
Install and uninstall
fnm install <version>
fnm install --lts
fnm install --latest
fnm installfnm uninstall <version>
Use and inspect
fnm use <version>
fnm usefnm use --install-if-missing
fnm currentfnm listfnm list-remotefnm list-remote --lts
Aliases and defaults
fnm default <version>
fnm alias <version> <name>
Run without switching
fnm exec --using <version> <command>
fnm exec --using <version> npx <pkg>
Version files and config
node --version > .node-version
| Value | Meaning |
|---|---|
22 |
Any 22.x |
22.11.0 |
That exact release |
v22.11.0 |
Same, with a v prefix |
lts/* |
Newest LTS |
lts/iron |
A named LTS line |
| Variable | Sets |
|---|---|
FNM_DIR |
Where versions are stored |
FNM_LOGLEVEL |
quiet, error or info |
FNM_NODE_DIST_MIRROR |
Download mirror |
FNM_ARCH |
Binary architecture |
FNM_VERSION_FILE_STRATEGY |
local or recursive |
FNM_COREPACK_ENABLED |
Run corepack enable |
FNM_RESOLVE_ENGINES |
Use package.json engines |
Troubleshooting
Recipes
curl -fsSL https://fnm.vercel.app/install | bash# open a new terminal, thenfnm install --ltsfnm default <version>node --version
cd myappnode --version > .node-versiongit add .node-version# teammates runfnm use --install-if-missing
# in ~/.bashrceval "$(fnm env --use-on-cd --version-file-strategy recursive --shell bash)"# then cd into any project with a version file
for v in 20 22 24; do fnm exec --using $v npm testdone



