🧙‍♂️ Easy Guide: Installing NVM on macOS for Developers
If you're a developer on macOS and juggling multiple versions of Node.js, NVM (Node Version Manager) is a must-have tool in your toolkit. It lets you install, switch, and manage different versions of Node effortlessly.
Here’s a clean, no-fluff guide to getting NVM up and running on your Mac.
âś… Step 1: Open Terminal
Let’s start simple. Open your Terminal. You can find it via Spotlight (Cmd + Space, then type Terminal) or go to Applications > Utilities > Terminal.
âś… Step 2: Install NVM via Curl
You’ll use the curl command to download and install NVM. Copy and paste this into your terminal:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash
âś… This command pulls the latest official version (as of now) from the NVM GitHub repo. You can find latest version here NVM Latest.
âś… Step 3: Configure Your Shell
Depending on the shell you're using (likely zsh or bash), you'll need to update your profile file so your system knows about NVM.
For Zsh (default on macOS Catalina and later):
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
Add those lines to your ~/.zshrc file:
nano ~/.zshrc
Paste the lines at the bottom, save with Ctrl + O, then exit with Ctrl + X.
For Bash:
Add the same lines to your ~/.bash_profile or ~/.bashrc.
âś… Step 4: Refresh the Terminal
After editing your profile file, reload it:
source ~/.zshrc
(or source ~/.bash_profile depending on your shell)
This reloads your profile and makes NVM available immediately.
âś… Step 5: Confirm NVM is Installed
Run this to verify:
nvm --version
If you see a version number (e.g. 0.40.2), you're good to go!
âś… Step 6: Install Node.js with NVM
You can now install Node.js using NVM. For example, to install the latest LTS version:
nvm install --lts
Or install a specific version:
nvm install 18
And switch between versions like:
nvm use 18
Want to make one your default?
nvm alias default 18
🎉 That’s It!
You’ve now got NVM installed and ready to manage Node.js versions like a pro. No more global version conflicts, no more Node-induced headaches. Just smooth sailing from here on.

