How to Install Node.js on Ubuntu, macOS & Windows (No Cap, It's Easy) file
POV: you just found a sick tutorial online, copied the commands, and got hit with node: command not found. Yeah, we've all been there. Node.js is basically the backbone of modern web dev — if you're building with React, Next.js, Express, or really anything JavaScript outside the browser — you need it installed first.
This is your no-fluff, get-it-done guide. Pick your OS and let's go.
First, What Even Is Node.js?
Node.js is a JavaScript runtime built on Chrome's V8 engine. Translation: it lets you run JavaScript code outside the browser — on your server, your terminal, your machine. npm (Node Package Manager) comes bundled with it, which is how you install literally every package you'll ever need.
LTS vs Current? Always grab the LTS (Long-Term Support) version unless you have a specific reason not to. It's stable, battle-tested, and won't randomly break your project.
🐧 Ubuntu
You've got three methods. The NVM route is the most goated — it lets you switch between Node versions like switching fits.
Method 1: Quick Install via APT (Fast & Easy)
sudo apt update
sudo apt install -y nodejs npm
Then verify with:
node -v
npm -v
Done. Minimal effort. But you're locked into whatever version Ubuntu's repo has, which might be kinda old.
Method 2: NodeSource PPA (Specific Version)
Want a specific, up-to-date LTS version? This is your move:
sudo apt update
sudo apt install -y curl
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install -y nodejs
The NodeSource nodejs package includes both node and npm — no separate install needed.
Method 3: NVM (The Pro Move 🏆)
This is the recommended path if you work on multiple projects. NVM lets you install, switch, and manage multiple Node versions without the drama:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
Restart your terminal (or run source ~/.bashrc), then:
nvm install --lts
nvm use --lts
node -v
🍎 macOS
Three routes here too, but Homebrew is the fan-favorite for Mac devs.
Method 1: Official Installer (.pkg)
The click-and-pray method — totally valid:
- Go to nodejs.org
- Download the macOS Installer (LTS)
- Run the
.pkgfile, accept the license, follow the prompts - Verify:
node -v&&npm -vin your terminal
Method 2: Homebrew (Recommended ✨)
If you're a Mac dev and don't have Homebrew... it's giving unserious. Install it first at brew.sh, then:
brew install node
Check it:
node -v
npm -v
Clean, simple, updatable with one command later.
Method 3: NVM on Mac
Best for M1/M2/M3 chip owners who juggle projects:
brew install nvm
mkdir ~/.nvm
Add NVM to your shell config (~/.zshrc), then:
nvm install --lts
nvm use --lts
🪟 Windows
Windows folks, Microsoft actually has solid docs on this now — and the recommended approach is nvm-windows.
Method 1: Official Installer (Easiest)
No terminal needed for this one: youtube
- Go to nodejs.org
- Download the LTS
.msiinstaller - Run it, accept the license, choose your install folder
- ✅ Make sure "Add to PATH" is checked
- Click Install, then open Command Prompt and run:
node -v
npm -v
Method 2: nvm-windows (The Smart Play 🎯)
If you're working on multiple projects or will be switching Node versions, use this: learn.microsoft
- Go to the nvm-windows GitHub releases page
- Download nvm-setup.zip, extract, run nvm-setup.exe
- Follow the setup wizard
- Open PowerShell as Admin, then:
nvm install lts
nvm use lts
node -v
Quick Cheat Sheet 📋
| OS | Easiest Method | Pro Method |
|---|---|---|
| Ubuntu | sudo apt install nodejs npm | NVM |
| macOS | .pkg from nodejs.org | Homebrew + NVM |
| Windows | .msi from nodejs.org | nvm-windows |
One Last Thing
After any install, always run node -v and npm -v to confirm everything's working. If you see version numbers — you're locked in. If not, check your PATH settings (especially on Windows). dev
Now go build something. Drop a comment if you're stuck on a step or if your OS decided to be cooked mid-install. We got you. 🛠


