If you’re looking for an easy guide to install Node.js and npm on OS X and macOS — this is it.
Before we get started, are you listening to JS Party? If not, you should be! Maybe start with our episode all about best practices for Node developers. ✊
The default method for installing Node.js is to download a pre-built installer for your platform, install it and make sure it’s on your
However, if you’re a Homebrew fan like me and prefer to install all of your packages with it — ensuring your packages are installed using the same commands and directories and allowing Homebrew to easily manage upgrades and updates — then this guide will help you get started.
Install Node.js and npm with Homebrew
First, install Homebrew.
brew update to make sure Homebrew is up to date.
As a safe measure you should run
brew doctor to make sure your system is ready to brew. Run the command below and follow any recommendations from brew doctor.
Next, add Homebrew’s location to your
$PATH in your
Next, install Node (npm will be installed with Node):
To test out your Node and npm install, try installing Grunt (you might be asked to run with sudo):
If that worked then congratulations — you’ve installed Node.js, npm, and Grunt.
If not — retrace your steps or post a question to Stack Overflow.
Listen to related podcasts on The Changelog
Since you’re interested in Node.js, npm, and Homebrew — listen to some recent related podcasts we’ve done on those subjects.
Note: The packages on this page are maintained and supported by their respective packagers, not the Node.js core team. Please report any issues you encounter to the package maintainer. If it turns out your issue is a bug in Node.js itself, the maintainer will report the issue upstream.
Android support is still experimental in Node.js, so precompiled binaries are not yet provided by Node.js developers.
However, there are some third-party solutions. For example, Termux community provides terminal emulator and Linux environment for Android, as well as own package manager and extensive collection of many precompiled applications. This command in Termux app will install the last available Node.js version:
Currently, Termux Node.js binaries are linked against
system-icu (depending on
Node.js and npm packages are available in the Community Repository.
CentOS, Fedora and Red Hat Enterprise Linux
Node.js is available as a module called
nodejs in CentOS/RHEL 8 and Fedora.
<stream> corresponds to the major version of Node.js.To see a list of available streams:
For example, to install Node.js 12:
For CentOS/RHEL 7 Node.js is available via Software Collections.
These resources provide packages compatible with CentOS, Fedora, and RHEL.
- Node.js snaps maintained and supported at https://github.com/nodejs/snap
- Node.js binary distributions maintained and supported by NodeSource
Debian and Ubuntu based Linux distributions
Node.js binary distributions are available from NodeSource.
Packages compatible with Debian and Ubuntu based Linux distributions are available via Node.js snaps.
Fast and simple Node.js version manager built in Rust used to manage multiple released Node.js versions. It allows you to perform operations like install, uninstall, switch Node versions automatically based on the current directory, etc.To install fnm, use this install script.
fnm has cross-platform support (macOS, Windows, Linux) & all poplar shells (Bash, Zsh, Fish, PowerShell, Windows Command Line Prompt)it's built with speed in mind and compatibility support for
The most recent release of Node.js is available via the www/node port.
Install a binary package via pkg:
Or compile it on your own using ports:
Node.js is available in the portage tree.
LTS versions of Node.js are available from IBM, and are available via the 'yum' package manager. The package name is
nodejs followed by the major version number (for instance,
To install Node.js 14.x from the command line, run the following as a user with *ALLOBJ special authority:
Node.js can also be installed with the IBM i Access Client Solutions product. See this support document for more details
Download the macOS Installer directly from the nodejs.org web site.
If you want to download the package with bash:
How to instructions and videos to upgrade the RAM in Aluminum Mac mini models: A1347/A1993, 2010, 2011, 2012, 2014, 2018). Actual max supported Mac mini memory, too. The Apple Mac mini 'Core i5' 2.3 (Mid-2011/Aluminum Unibody) features a 32-nm 'Sandy Bridge' 2.3 GHz Intel 'Core i5' (2415M) processor with two independent processor 'cores' on a single chip, a 3 MB shared level 3 cache, 2 GB of 1333 MHz DDR3 SDRAM (PC3-10600) memory, a 500 GB hard drive, and Intel HD Graphics 3000 with 288 MB of memory shared. Easily check which versions of mac OS, iOS, iPadOS, or watchOS are compatible with your Mac model or iDevice. Guide includes OS X 10.8.x to macOS 11.0.x. For the Mid 2011 Mac Mini and Mid 2011 MacBook Air Mac OS X 10.7.1 Update (for MacBook Air and Mac Mini 2011) 10.7.2 11C74 October 12, 2011 Darwin 11.2 About the OS X Lion v10.7.2 Update Adds iCloud, various bug fixes, minor user interface tweaks, Safari 5.1.1, and the ability to boot into Lion Recovery from a Time Machine disk. Mac mini 2011 os upgrade.
Install the binary package:
Or build manually from pkgsrc:
n is a simple to use Node.js version manager for Mac and Linux. Specify the target version to install using a rich syntax,or select from a menu of previously downloaded versions. The versions are installed system-wide or user-wide, and for moretargeted use you can run a version directly from the cached downloads.
See the homepage for install methods (boostrap, npm, Homebrew, third-party), and all the usage details.
If you already have
npm then installing
n and then the newest LTS
node version is as simple as:
Node.js is available in the pkgsrc tree:
Or install a binary package (if available for your platform) using pkgin:
nodenv is a lightweight node version manager, similar to
nvm. It's simple and predictable. A rich plugin ecosystem lets you tailor it to suit your needs. Use
nodenv to pick a Node version for your application and guarantee that your development environment matches production.
Nodenv installation instructions are maintained on its Github page. Please visit that page to ensure you're following the latest version of the installation steps.
Node Version Manager is a bash script used to manage multiple released Node.js versions. It allowsyou to perform operations like install, uninstall, switch version, etc.To install nvm, use this install script.
On Unix / OS X systems Node.js built from source can be installed usingnvm by installing into the location that nvm expects:
After this you can use
nvm to switch between released versions and versionsbuilt from source.For example, if the version of Node.js is v8.0.0-pre:
Once the official release is out you will want to uninstall the version builtfrom source:
Node.js is available through the ports system.
Using pkg_add on OpenBSD:
openSUSE and SLE
Node.js is available in the main repositories under the following packages:
- openSUSE Leap 42.2:
- openSUSE Leap 42.3:
- openSUSE Tumbleweed:
- SUSE Linux Enterprise Server (SLES) 12:
nodejs6(The 'Web and Scripting Module' must be added before installing.)
For example, to install Node.js 4.x on openSUSE Leap 42.2, run the following as root:
SmartOS and illumos
Osx Install Node-gyp
SmartOS images come with pkgsrc pre-installed. On other illumos distributions, first install pkgsrc, then you may install the binary package as normal:
Or build manually from pkgsrc:
Node.js snaps are available as
node on the Snap store.
Solus provides Node.js in its main repository.
Linux Node Install
Void Linux ships Node.js stable in the main repository.
Download the Windows Installer directly from the nodejs.org web site.
Osx Install Node Version Manager
IBM® SDK for Node.js - z/OS® is available in two installation formats,SMP/E and PAX. Select the installation format that applies to you: