Installing Node.js and NPM
This guide will walk you through installing and the Node Package Manager (NPM).
To complete this guide, you’ll need:
- A mac computer
- An internet connection
- About five minutes
You may already have it!
Depending on how your machine was set up, you might already have Node.js installed.
- Open the Terminal application. It lives in the Applications > Utilities folder. You can also press Command + Space, type “Terminal”, and select Terminal under Applications.
- In the Terminal, type node -v and press Enter.
If you see a version number (as shown above) then congratulations! You already have Node.js installed. Skip to the last section, Update Node.js, to ensure that your version is up to date.
If not, or if you see a response such as command not found: node then you do not have Node.js installed and you should continue with this article.
Follow the steps below to install Node.js and its package manager, NPM.
- Visit the website.
- On the page that opens, you’ll see two green buttons. Select the button on the left, which should have a title that ends with the letters LTS.
- When the download completes, open Finder and navigate to your Downloads folder.
- Right click on the package and select Open.
- If given a dialog asking if you’re sure you want to open the file, select Open.
- Follow the steps in the Install Node.js wizard.
- When the installation completes, accept the offer to move the installer to the Trash.
Check if it’s installed correctly
Now that we’ve installed Node.js, let’s check if it works.
- Open the Terminal again. (As a reminder: it lives in the Applications > Utilities folder. You can also press Command + Space, type “Terminal”, and select Terminal under Applications.)
- Type node -v and press Enter.
If you see a version number (as shown above) then congratulations! You’ve installed Node.js and NPM.
Should you need a newer version of Node, here’s how: