What’s Node.js and NPM?
Node.js is a JavaScript-based environment which you can use to create web-servers and networked applications.
NPM is a “package manager” that makes installing Node “packages” fast and easy. A package, also called a module, is just a code library that extends Node by adding useful features. For example, the “request” module simplifies the process of making HTTP requests so you can easily get web resources from other sites.
NPM is installed when you install Node.js.
let's see the Installation steps
Installing Node.js and NPM is pretty straightforward using Homebrew. Homebrew handles downloading, unpacking and installing Node and NPM on your system. The whole process (after you have XCode and Homebrew installed) should only take you a few minutes.
Open the Terminal app and type
brew install node.
wait for a secs. Homebrew downloads some files and installs them. And that’s it.
Make sure you have Node and NPM installed by running simple commands to see what version of each is installed:
Test Node. To see if Node is installed, type
node -v
This should print the version number so you’ll see something like this v12.4.0
Test NPM. To see if NPM is installed, type
npm -v
This should print the version number so you’ll see something like this 1.4.27