How to download and install node.js and npm on macOS

Akshay Devkate
Nerd For Tech
Published in
2 min readSep 7, 2021

--

Photo by Andrew Neel on Unsplash

Node.js is a free and open source cross-platform runtime environment for developing server-side and networking applications. Node.js programs are written in JavaScript and run on the Node.js runtime on OS X, Microsoft Windows, and Linux. Node.js also has a wide library of JavaScript modules, which makes developing Node.js web applications much easier. Node package management is abbreviated as NPM. Node.js is a free and open source cross-platform runtime environment for developing server-side and networking applications. Node.js programs are written in JavaScript and run on the Node.js runtime on OS X, Microsoft Windows, and Linux. Node.js also has a wide library of JavaScript modules, which makes developing Node.js web applications much easier. Node package management is abbreviated as NPM.

Download .pkg file from node.js official website

Visit following website and click on macOS logo to start download.

Start Installing node.js

After downloading .pkg file from the website you need to open it. This will initiate am installer that will guide you through installation process. Which is pretty simple. You can complete the steps by following the steps below:

  1. Introduction
  • Select continue

2. Licences

  • Select continue
  • Select Agree

3. Installation type

  • Select Install
  • You need to enter your mac password once to begin installation.
  • Select Install Software

4. Summary

  • Select close

Installing and updating npm

Node.js always comes with specific version of npm. npm is not automatically updated by Node.js itself. So it is a best practice to check npm version once the node.js is installed. . As a result, there’s generally always a newer version of npm than the one that comes pre-installed with a particular version of Node.

You can update npm using following command

$ sudo npm install npm — global

Verifying the downloads

Now check whether node.js and npm is installed correctly with the latest versions. You can check them using following commands.

For checking node.js version.

$ node -v

For checking npm version.

$ npm -v

Now you’ve got Node.js and npm installed and ready to use on your Mac. It’s time to start exploring!

--

--