← Back Published on

How to install Node.js on Mac Os.

Node.js is a JavaScript runtime environment that is open-source and cross-platform.

Outside of the browser, Node.js operates the V8 JavaScript engine, which is at the heart of Google Chrome. As a result, Node.js is extremely fast.

When you install Node.js, NPM is also installed.

WHAT IS NPM?

NPM is a "package manager" that makes it simple to install Node "packages." A package, sometimes known as a module, is a code library that adds helpful functionalities to Node.

Because you'll need to use the Mac OS terminal to install and test Node and NPM, you should be familiar with it. To utilize Node.js and NPM, you'll also need the terminal. The Terminal application can be found in the Applications folder's Utilities folder.

Although there are other options for installing Node, we recommend using Homebrew. Homebrew allows you to avoid the security risks involved with installing software such as Node and Node modules using the sudo command.


INSTALL HOMEBREW.

Using Homebrew, you can install Node.js and NPM with relative ease. Node and NPM are downloaded, unpacked, and installed on your system via Homebrew. After you've installed Homebrew, the rest of the process should just take a few minutes.

INSTALLATION GUIDE.

1:Install Homebrew and update to the latest version:

Type brew update into the Terminal app. This adds a list of the newest Node versions to Homebrew.

Type brew install node into the terminal.

Then wait. Homebrew will download and install several files and that's all there is to it. Your installation is finished.

2:Test your Installation:

Well before you close the terminal, you need to check if the right node and version are installed.

Test if Node and NPM are installed by running the following commands on the terminal:

  • Node Testing: Type node-v in Terminal to see if Node is installed. This should print the version number, which should look like this v0.10.31.
  • NPM Testing: Type npm -v in the terminal to see if NPM is installed. This should also print the version number, which should look like this [1.4.27].

How to Keep Node and NPM Up to Date.

If your Node and NPM version is outdated, You can update the app via Homebrew.

New versions of Node and NPM are released regularly. You would want to stay up to date to use the best and newest features.

Upgrade Node: brew upgrade node

How to Remove Node and NPM.

A good product is a product whereby the user can make choices.

Homebrew can be used to uninstall packages that it has installed using this code.

uninstall node brew