If you are reading this, you are looking to leverage the cool Javascript packages from npm and run these outside of a browser for testing and utilising apps. As you ideally want to test your applications on multiple versions of npm to ensure they work for users on different versions. That is:
Visit NodeJS at nodejs.org/en/download/ and install this onto your Mac laptop.
You'll find that npm is installed with Node.js. As npm is distributed with Node.js- which means that when you download Node.js, you automatically get npm installed on your computer.
Confirm that it is installed correctly by checking your version of npm and Node.js§.
To see if you already have Node.js and npm installed and check the installed version, run the following commands:
$ node -v
npm is a separate project from Node.js. So even if you’ve just downloaded Node.js (which also includes npm), you’ll probably need to update your npm.
To update your npm, type this into your terminal:
$ sudo npm install npm@latest -g
$ npm -v
You should be good to go to enjoy Javascript packages from npm now.
Get npm!
Install Node.js, npm, and stay up-to-date. npmjs.com/get-npm
NPM - Downloading and installing Node.js and npm. https://docs.npmjs.com/downloading-and-installing-node-js-and-npm