How to Install npm on a Mac: Methods, Variables, and What to Know First

npm (Node Package Manager) is the default package manager for Node.js and one of the most widely used tools in modern web development. If you're working with JavaScript frameworks, building web apps, or running frontend tooling, you'll almost certainly need it. Installing npm on a Mac is straightforward — but which method you choose depends on your workflow, your Mac's architecture, and how you plan to manage Node versions over time.

What npm Actually Is (and Why It Comes With Node.js)

npm doesn't ship as a standalone installer. It's bundled with Node.js, which means installing Node.js automatically installs npm alongside it. When developers talk about "installing npm on a Mac," they're really asking how to install Node.js in a way that fits their environment.

The version of npm you get depends on the version of Node.js you install. As of recent releases, npm v9 and v10 are the versions most commonly paired with current Node.js LTS (Long-Term Support) builds.

The Three Main Installation Methods

1. The Official Node.js Installer (Simplest Path)

The Node.js website offers a .pkg installer for macOS. You download it, run it, and both node and npm are available globally in your terminal within minutes.

Best for: beginners, solo developers, or anyone who needs a quick setup and won't be juggling multiple Node.js versions.

Drawback: This method installs Node.js into /usr/local/, which can cause permission issues when installing global packages. You may find yourself needing sudo for global npm installs — a pattern that's generally discouraged in modern development.

2. Homebrew (Popular Among Mac Developers)

Homebrew is a package manager for macOS that many developers already use to manage CLI tools. Installing Node.js through Homebrew looks like this in the terminal:

brew install node 

This installs Node.js and npm together, managed through Homebrew's ecosystem.

Best for: developers already using Homebrew who want a clean, consistent CLI environment.

Consideration: Homebrew ties your Node.js version to Homebrew's release cycle. Upgrading Node becomes a brew upgrade node command, but you don't get fine-grained control over which exact version is active. If you're working across projects with different Node.js version requirements, this can become limiting.

3. A Node Version Manager — nvm or Volta ⚙️

nvm (Node Version Manager) is the most widely recommended approach for developers who work on multiple projects. It lets you install, switch between, and manage multiple versions of Node.js (and the npm versions bundled with them) without touching your system Node or needing sudo.

Install nvm via its install script, then use commands like:

nvm install --lts nvm use 20 

Volta is a newer alternative that focuses on per-project toolchain pinning — useful in team environments where everyone needs the same Node/npm version.

Best for: developers managing multiple projects, contributing to open source, or working in team environments with strict version requirements.

Consideration: nvm requires shell configuration (adding lines to your .zshrc or .bash_profile). It's a minor extra step but important to get right, especially on Macs running zsh by default since macOS Catalina.

Apple Silicon vs. Intel Macs: Does Architecture Matter?

Yes — but less than it used to. 🍎

Macs running Apple Silicon (M1, M2, M3 chips) use ARM architecture. Earlier versions of Node.js didn't have native ARM builds, which meant running Node through Rosetta 2 (Apple's compatibility layer). Current Node.js LTS releases ship with native ARM64 support, so installation on Apple Silicon Macs works cleanly with any of the methods above.

Where you might still hit issues: older .pkg installers, outdated Homebrew setups, or nvm configurations that predate native Apple Silicon support. Checking that you're using a current Node.js LTS release largely avoids these problems.

Verifying Your Installation

Regardless of method, the check is the same. After installation, open Terminal and run:

node -v npm -v 

Both commands should return version numbers. If npm -v returns an error but node -v works, the npm installation didn't complete correctly — a scenario most common with manually modified Node.js setups.

Updating npm After Installation

npm can update itself independently of Node.js:

npm install -g npm@latest 

This is useful when a project requires a newer npm version than what shipped with your Node.js install. With nvm, you can also install a different Node.js version and get the npm version bundled with it.

Key Variables That Shape the Right Approach

FactorWhy It Matters
Number of projectsMultiple projects often need different Node versions
Team vs. solo workTeams benefit from pinned versions via Volta or .nvmrc files
Mac chip typeARM vs. Intel can affect compatibility with older tooling
Shell environmentzsh (default on modern Macs) requires specific nvm config
Existing toolsHomebrew users may prefer a Homebrew-based setup
Permission preferencesAvoiding sudo for global installs affects which method is cleanest

Global Package Permissions: A Common Stumbling Block

One issue that catches many developers regardless of install method: global npm package installation permissions. When npm is installed into a system-level directory, running npm install -g for tools like create-react-app or typescript often requires elevated privileges.

nvm sidesteps this entirely because it installs Node.js into your home directory. The official .pkg installer can be configured to avoid this too, but it requires manually setting a custom global prefix — an extra step that nvm handles automatically.


The "right" installation method on a Mac isn't universal. A developer building a single app on a personal machine has genuinely different needs than someone maintaining several production projects across a team — and what's seamless in one setup can cause version conflicts or permission headaches in another.