For example, to install Node.js default version with Homebrew, you execute the following command: $ brew install node Homebrew also provides an online package browser to browse all the available packages for macOS and Linux. Brew 下 安装node 和 npm. 其实npm是nodejs的包管理器(package manager)。我们在Node.js上开发时,会用到很多别人已经写好的javascript代码,如果每当我们需要别人的代码时,都根据名字搜索一下,下载源码,解压,再使用,会非常麻烦。. You should install node.js with nvm, because that way you do not have to provide superuser privileges when installing global packages (you can simply execute 'npm install -g packagename' without prepending 'sudo'). Brew is fantastic for other things, however. 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.
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.
It is also very useful to test your code with old Node versions.
See https://github.com/creationix/nvm for more information about this option.
Brew Nodejs 14

Brew Node Js
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 Nodejs Lts
Download my free Node.js Handbook and check out my Node.js Course!
