I spent a weekend debugging a "node: command not found" error because I'd skipped a step in the Node.js install. So I wrote down everything I wish I'd known.
If you want the version with OS-detection tabs and troubleshooting, here's the full guide:
๐ How to Install Node.js on Windows, Mac, and Linux
Here's the short version.
Which version should you install?
Always install LTS (Long Term Support). It's stable, tested, and supported for years. Skip "Current" unless you need bleeding-edge features.
Windows
The fastest method: go to nodejs.org, download the LTS .msi, double-click, click Next through the wizard.
Verify:
$ node -v
v22.11.0
$ npm -v
10.9.0
If you get "'node' is not recognized" โ close and reopen your terminal. That fixes 90% of cases.
macOS
If you have Homebrew:
brew install node
That's it. Homebrew handles updates too.
Linux
Use nvm โ it avoids permission headaches and lets you switch versions per project:
bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc
nvm install --lts
nvm use --lts
The classic mistake
Don't install Node.js from your Linux distro's default repos. The version is often 2โ3 years old, and you'll hit "this feature isn't supported" errors on modern packages. Use nvm.
What you actually get
Installing Node.js installs two things:
ยท node โ the runtime
ยท npm โ the package manager (bundled automatically)
You don't install npm separately. Ever.
Quick test
Create hello.js:
js
console.log("Node version:", process.version);
Run it:
$ node hello.js
Node version: v22.11.0
Working.
The full guide covers three methods per OS, plus troubleshooting for permission errors, EACCES issues, and version-switching with nvm:
๐ How to Install Node.js (Full Guide)
I also built a small collection of free browser-based dev tools (JSON formatter, regex tester, Base64 encoder, Unix timestamp converter) โ no signup, no ads, everything runs locally:
If you spot anything wrong or outdated in the guide, comment below โ I'll fix it.
Top comments (0)