Homebrew Node



Node.js can be installed in multiple ways on a system, and the upgrade instructions depend on how you first installed it.

Homebrew node

As of this PR to homebrew/versions and this PR to homebrew, the answers involving brew tap homebrew/versions or.-lts packages no longer work. The correct answer is now: brew install node@ Where is 0.10, 0.12, 4, etc.For example, to install Node.js v6 (as of this writing, the most recent LTS version). 📦 Bundler for non-Ruby dependencies from Homebrew, Homebrew Cask and the Mac App Store. Ruby homebrew tap bundle cmd Ruby MIT 230 3,638 2 (2 issues need help) 0 Updated Apr 19, 2021.github.

If you installed Node using the official package

Homebrew Node

The easiest way to install Node is to download the official package from the Node.js website.

Homebrew Node 12

The official package contains an installer that will detect the existing version of Node.js and it will overwrite it with the new one.

If you installed Node using Homebres (on macOS)

Homebrew is a very popular way to install Node.js on a Mac.

If you did use Homebrew, upgrading Node is as simple as running

Homebrew might ask you to upgrade your xCode version to compile the package.

If you use nvm

nvm is a popular way to run Node. It allows you to easily switch the Node version, and install new versions to try and easily rollback if something breaks, for example.

It is also very useful to test your code with old Node versions.

When you use nvm, you can check the current version you are running by typing nvm current, which will give you the same result as node -v.

Brew

Homebrew Node 8

To list all the installed versions, run nvm ls.

Homebrew Node Version Manager

You can install a new Node release (or any old Node release, too) using nvm install <VERSION>, for example:

Once installed, you can set that Node.js version to be the one to use by typing

This will set 10.8.3 to the default Node version, system-wide.

Beer Brewing At Home

Download my free Node.js Handbook and check out my Node.js Course!