Written in Rust, fnm is lightning-fast, cross-platform, and adds zero lag to your shell startup. Plus, it automatically switches Node versions as you jump between different projects.
Here is how to get it running on your Linux system in under 2 minutes.
Step 1: Install fnm
Run the official installation script in your terminal:
curl -fsSL https://fnm.vercel.app/install | bash
(Make sure you have curl and unzip installed—most Linux distros have these by default).
Step 2: Configure Your Shell
The installer will configure your shell profile automatically, but you need to make sure the environment variables and auto-switching are active.
Open your shell configuration file (~/.bashrc, ~/.zshrc, or ~/.config/fish/conf.d/fnm.fish) and ensure fnm env is evaluated with the --use-on-cd flag.
For Bash or Zsh, add this line to the bottom of your ~/.bashrc or ~/.zshrc:
eval "$(fnm env --use-on-cd)"
Then, reload your terminal profile:
source ~/.bashrc # or source ~/.zshrc if you use Zsh
(The --use-on-cd flag is a killer feature: it reads any .nvmrc or .node-version file in your project folders and automatically switches your active Node version when you cd into them).
Step 3: Install Node.js (LTS)
Now that fnm is set up, installing the latest Long-Term Support (LTS) version of Node.js takes just two commands:
fnm install --lts
fnm use lts-latest
Verify Your Installation
Check that Node.js and npm are successfully installed and active:
node -v
npm -v
You should see the latest LTS version number printed to your console.
That’s it, nodejs and npm is now in your system. Feel free to check the Miniconda tutorial so you can apply this within a conda env: Miniconda Installation Guide (Linux)