How to Install Node.js on Mac: Methods, Tools, and What to Know First
Node.js is the runtime that lets you run JavaScript outside of a browser — on your machine, on a server, or as part of a build pipeline. If you're doing any modern web development on a Mac, chances are you'll need it sooner rather than later. The good news: installing Node on macOS is straightforward. The less obvious part is that how you install it matters more than most guides admit.
What Node.js Actually Is (and Why Installation Method Matters)
Node.js isn't just a single binary you download and forget. It's a runtime environment with its own version lifecycle — different projects often depend on different versions of Node, and those versions aren't always interchangeable.
Installing Node the "quick" way works fine if you're experimenting or building a single personal project. But if you're working across multiple projects, contributing to open source, or following along with a team, your installation method affects how easily you can switch between Node versions, update cleanly, and avoid permission issues down the line.
The Three Main Ways to Install Node on Mac
1. The Official Installer (nodejs.org)
The simplest entry point. You go to nodejs.org, download the macOS .pkg installer, and run it like any other app. It installs Node and npm (Node Package Manager) globally.
Works well for: complete beginners, one-off scripts, or anyone who just needs Node running quickly and won't be juggling versions.
Drawback: updating requires re-downloading an installer, and switching Node versions is cumbersome. It also installs into system directories, which can occasionally cause permission headaches when installing global packages.
2. Homebrew
Homebrew is the most popular package manager for macOS. If you already use it, installing Node is a single command:
brew install node This installs the latest stable version of Node and npm. Updating later is just brew upgrade node.
Works well for: developers who already use Homebrew, prefer terminal-based workflows, and don't need to frequently switch between Node versions.
Drawback: Homebrew installs one version of Node at a time (the current one). Switching versions requires extra steps or workarounds.
3. A Version Manager (nvm, fnm, or Volta) 🛠️
This is the approach most experienced developers eventually settle on. A Node version manager lets you install multiple versions of Node and switch between them per-project or per-terminal session.
nvm (Node Version Manager) is the most widely used:
# Install nvm (check nvm's GitHub for the current install command) curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash # Then install a Node version nvm install --lts # Switch versions nvm use 18 fnm (Fast Node Manager) is a newer, faster alternative written in Rust, with similar functionality.
Volta takes a different approach — it pins Node versions to individual projects via package.json, making version consistency automatic across a team.
Works well for: anyone doing professional development, working on multiple projects, or collaborating with others who need consistent environments.
Key Variables That Should Shape Your Choice
Not all Mac setups or use cases are the same. A few factors that meaningfully change what works best:
| Factor | How It Affects Your Choice |
|---|---|
| Apple Silicon vs Intel Mac | Both are supported, but some older nvm versions had ARM compatibility quirks. Current versions handle both architectures well. |
| macOS version | Older macOS versions may have outdated default shells (bash vs zsh). nvm's shell config steps differ depending on your shell. |
| Existing Homebrew setup | If Homebrew is already central to your workflow, adding Node through it is natural. |
| Team environment | If your team uses Volta or a specific nvm version, matching their setup avoids "works on my machine" issues. |
| Single vs multiple projects | One project = any method works. Multiple projects with different Node requirements = version manager is hard to skip. |
Common Gotchas Worth Knowing
Permission errors when installing global packages are a frequent complaint when Node is installed via the official .pkg. This usually happens because the global node_modules directory sits in a system path. Version managers avoid this by installing Node in your home directory.
Shell configuration matters. Tools like nvm add lines to your .zshrc or .bash_profile to activate on startup. If you skip this step or use a non-standard shell setup (like a plugin manager for zsh), Node might not be recognized in new terminal windows.
npm comes bundled. You don't install npm separately — it ships with Node. But npm itself has a version that's separate from Node's version. Running npm install -g npm updates npm independently of Node.
LTS vs Current. Node publishes two tracks: LTS (Long Term Support) — stable, recommended for most production use — and Current, which has the latest features but less stability. For most developers, LTS is the safer default. 🔄
After Installation: Verifying It Worked
Regardless of method, you can confirm Node is installed and check the version:
node -v npm -v If both return version numbers, your environment is ready. If you get command not found, it usually points to a shell configuration issue — the PATH isn't set up to find Node.
The Part That Depends on Your Setup
The method that's "right" genuinely varies. A solo developer building a weekend project has different needs than someone onboarding to a team that uses Volta and enforces .nvmrc files. Someone on a brand-new M3 Mac with a clean environment faces different considerations than someone working on an older Intel machine with an existing Homebrew configuration.
The installation itself is simple in all three cases. What takes more thought is how your specific workflow, machine, and project context intersect with each approach — and that's something only your actual setup can answer.