Homebrew is a program that allows you to install specific versions of Node.js (and other software). To update from Node.js 10 to Node.js 12 using Homebrew, open a terminal and run the following commands. Node version manager is a script to manage multiple active node.js versions. And I usually install most applications using homebrew. NOTE: install NVM with Homebrew is not officially supported. So these are the steps to install NVM with Homebrew: Install NVM with Homebrew Install NVM is very easy just with this command: brew install nvm First setup.
Brew install node@8 Also remember that you can install more than 1 node package at the same time, but you cannot have them available at the same time. So if you have the latest/generic node package already installed you need to unlink it first: brew unlink node And then you can link a different version: brew link node@8.
Node.js can be installed in different ways.
Let me how you the most common and convenient ones.
Official packages for all the major platforms are available at https://nodejs.org/en/download/.
There you can choose to download an LTS version (LTS stands for Long Term Support) or the latest available release. As usual, the latest version contains the latest goodies.
On the site they have packages for Windows, Linux, macOS.
One very convenient way to install Node.js is through a package manager. In this case, every operating system has its own.
On macOS, Homebrew is the de-facto standard, and - once installed - allows to install Node.js very easily, by running this command in the CLI:
Other package managers for Linux and Windows are listed in https://nodejs.org/en/download/package-manager/
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.
Brew Update Node
It is also very useful to test your code with old Node versions.
Brew Node
See https://github.com/creationix/nvm for more information about this option.
My suggestion is to use the official installer if you are just starting out and you don’t use Homebrew already, otherwise, Homebrew is my favorite solution because I can easily update node by running brew upgrade node
.
In any case, when Node is installed you’ll have access to the node
executable program in the command line.
Brew Node Install
Download my free Node.js Handbook and check out my Node.js Course!