Node.js and npm

Learn how to install Node.js and npm on your machine.

We’ll be using Node.js and the related npm (Node Package Manager) utility throughout this course. For example, many of the sample command-line utilities are written in Node.js and are installed and updated using npm. We first refer to these two important tools in Modeling APIs.

Checking for Node.js

You may already have Node.js and npm installed. You can check on this by typing the following on the command line:

node -v

If Node.js is installed, you should get a response that is the version number of your release of Node.js. For example, the response on your machine might look like this:

v12.22.12

The exact version isn’t important, but you should be using version 10 or above because that’s the version we used to write the code.

Checking for npm

When Node.js gets installed, the latest version of npm should also be installed automatically. You can check this with the following command:

npm -v

The response should be the currently installed version on your machine. For example, your machine might respond with this:

6.14.16

The exact version isn’t important, but you should use at least version 6 or above. You might also be prompted to update your npm instance, and that’s usually a good idea.

Get hands-on with 1200+ tech skills courses.