How to Install Node.js on Mac: Methods, Variables, and What to Expect

Node.js is a JavaScript runtime that lets you run JavaScript code outside of a browser — on a server, in a terminal, or as part of a build process. If you're doing any modern web development on a Mac, there's a good chance you'll need it. The installation process is straightforward, but there are genuinely different ways to do it, and the right approach depends on how you plan to use it.

What Node.js Actually Does (and Why the Install Method Matters)

When you install Node.js, you're installing two things: the Node runtime itself and npm (Node Package Manager), which handles the thousands of libraries and tools the JavaScript ecosystem depends on.

The reason install method matters isn't just preference — it affects how you manage versions, switch between projects, handle permissions, and update Node over time. A developer working on multiple projects with different Node requirements has very different needs from someone installing it once to run a single build tool.

The Three Main Ways to Install Node.js on Mac

1. The Official Installer (Simplest Path)

The most direct method is downloading the macOS installer package from nodejs.org. You download a .pkg file, run it, click through the prompts, and Node is installed system-wide.

This method works and requires no command-line experience. The tradeoff is that it installs Node globally into system directories, which can create permission issues when installing global npm packages. You may find yourself needing sudo for certain operations, which is generally a sign that something isn't configured ideally.

Best suited for: beginners, people who only need one version of Node, or those running a quick one-off project.

2. Homebrew (Popular Middle Ground)

Homebrew is a package manager for macOS that many developers already use. If you have it installed, adding Node is as simple as running:

brew install node 

Homebrew manages the installation path cleanly, integrates with the rest of your Mac development environment, and makes updates easy (brew upgrade node). It handles a lot of the permission complexity the official installer can create.

The limitation: Homebrew installs one version of Node at a time. If you need to switch between versions — say, an older project requires Node 16 and a newer one requires Node 20 — Homebrew alone gets awkward.

Best suited for: developers who already use Homebrew and work with a single Node version most of the time.

3. A Version Manager: nvm or fnm (Most Flexible)

nvm (Node Version Manager) and fnm (Fast Node Manager) are tools specifically built to install and switch between multiple Node versions on the same machine. This is how most professional developers set up Node on Mac.

With nvm, for example, you can:

  • Install multiple Node versions simultaneously
  • Switch versions per project using a .nvmrc file
  • Avoid system-level permission issues entirely
  • Roll back to an earlier version if something breaks

fnm is a newer alternative to nvm — written in Rust, significantly faster, and compatible with nvm's .nvmrc files. For most use cases they accomplish the same thing; fnm just performs faster on startup.

Both require some comfort with the terminal. You install the manager first (via a curl command or Homebrew), then use it to install Node versions.

Best suited for: developers managing multiple projects, working in teams, or who expect to update Node periodically.

Key Variables That Change the Right Approach

FactorWhy It Matters
macOS versionApple Silicon (M1/M2/M3) Macs have had compatibility nuances with some older Node versions; newer Node releases handle ARM natively
Number of projectsOne project = simpler install; multiple projects with different requirements = version manager
Terminal comfortOfficial installer needs zero terminal use; nvm/fnm require basic comfort with shell commands
Existing toolsAlready using Homebrew? It's a natural fit. Starting fresh? Any method works
Shell typemacOS uses zsh by default since Catalina; nvm requires a specific setup in your .zshrc file — missing this step is the most common install issue

The Apple Silicon Factor 🍎

If you're on an M-series Mac, it's worth knowing that Node.js has had full native ARM64 support since Node 16. Older versions may run under Rosetta 2 (Apple's compatibility layer), which works but adds overhead. If you're starting fresh on Apple Silicon, installing a recent LTS version via any method should give you native ARM performance without extra steps.

The version manager approach is particularly useful here because you can clearly see and control which architecture a given Node version is running under.

The Most Common Install Problems (and Why They Happen)

Permission errors when installing global packages — almost always caused by the system-level install from the official .pkg. Version managers avoid this by installing Node in your home directory.

node command not found after install — usually a shell configuration issue. The install didn't update your PATH. This requires adding a line to your .zshrc or .bash_profile file depending on which shell you use.

nvm not loading in new terminal windows — nvm needs to be initialized in your shell config file. If the initialization lines aren't in .zshrc, nvm loads inconsistently.

Wrong Node version running — common when multiple install methods have been used on the same machine. Running which node in the terminal tells you exactly which installation is active.

What Stays the Same Across All Methods 🔧

Regardless of how you install Node, a few things are consistent:

  • npm comes bundled — you don't install it separately
  • The node and npm commands work the same way once installed
  • Global packages (like typescript, eslint, or create-react-app) install the same way via npm install -g
  • Updating Node means either re-running the installer, running brew upgrade node, or using your version manager's update commands

How Your Setup Shapes the Decision

A student running their first JavaScript project outside the browser and a developer maintaining five client codebases on different Node versions are both asking the same question — but the answer that serves them well looks completely different. The version you need, the tools already on your system, your shell configuration, and whether you're on Intel or Apple Silicon all feed into which method will cause you the least friction over time. The technical steps for any of these approaches are well-documented, but which set of steps fits your actual workflow is something only your own setup can tell you.