How do I install NVM on a Mac?
Short answer: open Terminal and run the official script:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bashThen run source ~/.zshrc or open a new terminal, check it with command -v nvm and install Node.js with nvm install --lts. It works on Apple Silicon (M1 to M5) and Intel Macs, and you don't need sudo. You can also use brew install nvm, but the nvm team doesn't support that method.
nvm (Node Version Manager) installs several versions of Node.js in your user folder and switches between them with one command. The latest version is 0.41.0, from November 4, 2026, and nvm install --lts installs Node.js 26, the current LTS.
On a Mac: run the install script, load nvm in zsh and install Node.js 26 LTS.
nvm on Mac at a glance
| What you want | Command |
|---|---|
| Install nvm (recommended) | The official script (step 2) |
| Install nvm with Homebrew | brew install nvm (see below) |
| Load it in the current terminal | source ~/.zshrc |
| Check that it is installed | command -v nvm |
| Install the latest LTS | nvm install --lts |
| Install a specific version | nvm install 24 |
| Switch version | nvm use 24 |
| Set the default version | nvm alias default 26 |
| List installed versions | nvm ls |
Step 1: prepare your Mac
Since macOS Catalina, the default shell is zsh, and it reads ~/.zshrc. The script adds nvm to that file, but only if it exists. Create it, just in case:
touch ~/.zshrcThe script downloads nvm with git. If your Mac asks you to install the Command Line Tools the first time, accept, or install them yourself with xcode-select --install.
If you already installed Node.js from nodejs.org or with Homebrew, it's better to remove it first (brew uninstall node for Homebrew) so it doesn't get in the way of nvm.
Step 2: run the install script
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bashThe script clones nvm into ~/.nvm and adds these lines to ~/.zshrc:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvmTo update nvm later, run the same command with the new version number.
