fnm


fnm

Overview

Fast Node.js version manager provides a quick way to install, switch, and uninstall different Node.js versions.

Install a specific version

fnm install {{node_version}}

Install the desired Node.js version. This command creates a new environment for that version.

List all available versions

fnm list

List all installed Node.js versions and highlights the default one. Useful to see what is currently available.

Use a specific version in the current shell

fnm use {{node_version}}

Activate the selected Node.js version for your current terminal session.

Set the default Node.js version

fnm default {{node_version}}

Set the default version to be used when no specific version is requested.

Uninstall a given version

fnm uninstall {{node_version}}

Remove the specified Node.js version from your environment. This cleans up unused versions.

Common pitfalls

  • Missing installation: Ensure you have fnm installed before using it.
  • Version mismatch: Verify that the node version is compatible with your system (e.g., 32-bit or 64-bit).

Examples

  1. Install Node.js v14:
fnm install 14
  1. List all installed versions:
fnm list
  1. Use Node.js v12 in current shell:
fnm use 12
  1. Set default to Node.js v13:
fnm default 13
  1. Uninstall Node.js v14:
fnm uninstall 14

Notes

  • fnm is a lightweight tool that does not require complex setup.
  • Keep your environment clean by uninstalling unused versions.

See Also