Install Node.js and npm using Homebrew on OS X and macOS
Last updated 2 months ago
Install Node.js and npm with Homebrew
First, install Homebrew.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
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):
brew install node
To test out your Node and npm install, try installing Grunt (you might be asked to run with sudo):
npm install -g grunt-cli
All code snippets are licensed GPLv2 or later unless otherwise stated.