Node.js
Install Node.js inside WSL, not on Windows. VS Code's WSL extension and every npm / pnpm script should see the Linux binary.
This guide uses fnm (Fast Node Manager): a single Rust binary that reads .nvmrc, .node-version and package.json engines. It is faster than nvm and does not need to be sourced as a shell function.
curl and unzip are required. The zsh step already installed both.
Install fnm
curl -fsSL https://fnm.vercel.app/install | bash
The installer puts the binary in ~/.local/share/fnm and appends a loader to ~/.zshrc. Replace that loader with the version that switches Node when you cd into a project:
# fnm
export PATH="$HOME/.local/share/fnm:$PATH"
eval "$(fnm env --use-on-cd --shell zsh)"
Reload:
source ~/.zshrc
fnm --version
Install Node.js LTS
As of October 2026, Active LTS is the 24.x line. Do not pin a patch in your notes; let fnm pick the current LTS:
fnm install --lts --use
fnm default lts-latest
node -v
npm -v
fnm install --lts aliases that version as lts-latest. fnm default lts-latest is what new shells use when a project does not specify a version.
Everyday commands
fnm ls # installed versions
fnm ls-remote --lts # available LTS releases
fnm install 22 # another major (for example Maintenance LTS)
fnm use 24 # this shell only
fnm default 24 # new shells
fnm uninstall 22
Drop a .node-version (or .nvmrc) in a repo so --use-on-cd selects that version when you enter the directory:
echo 24 > .node-version
Why not nvm or a Windows installer?
- nvm works, but it is a shell script you
sourceon every prompt. fnm is a binary and starts faster. If a teammate's README saysnvm use, fnm still honors.nvmrc. - The Windows Node.js installer puts
nodeon the WindowsPATH. Mixing that with WSL leads to wrong binaries, CRLF scripts and native-addon mismatches. Uninstall it if it is already there (winget uninstall -e --id OpenJS.NodeJS.LTS).