Manage Node Versions With nvm

Install Node releases and switch between them in a shell.

macOSpackagesshellversionLow risk
Run nvm install --lts to install the latest LTS Node, then nvm use --lts to activate it.

01Command

Command
$ nvm install --lts && nvm use --lts

02What it does

nvm is a shell function that installs Node versions under ~/.nvm and rewrites PATH to the selected one. A .nvmrc file per project lets nvm use read the required version, and nvm exec runs a command under a specific version.

03Risk

RiskLow risk
CompatibilitymacOS with Homebrew installed
!Warning: nvm is a shell-sourced script, so it must be loaded in each shell; tools that spawn non-interactive shells may not see the selected Node.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Homebrew formula: nvm
    Homebrew · vendor-doc · 2026-09-20
    Evidence: Manage multiple Node.js versions. Packages nvm, the long-standing Node Version Manager shell script.

Last verified: 2026-09-22 · Category: Developer

06Related solutions