Setting up NodeJs for development

Modern frontends are typically built using NodeJS a browserless form of JavaScript. This page provides details around how to install NodeJS and it’s supporting library NPM.

If there is anything missing or not clear in this guide, please leave a comment below.

What are we going to install?

NodeJS

NodeJS is used to run code that is written in JavaScript outside of a browser.

Node Package Manager

Node Package Manager is an automated build tool that is responsible for building Node projects and triggering and handling the a Node projects dependencies. Handly, it is installed alongside Node when you run the installer.

Installing on Mac

  1. Firstly, download the LTS version NodeJS that can be found here: https://nodejs.org/en/
  2. Once downloaded run the installer and complete the installation steps (You will see that it will mention installing both node and npm).
  3. Once the installation has completed open up a terminal window (Found in /applications/utilities folder) and enter node -v. You should see output similar to this to indicate Node is installed and ready to go:

v10.15.1

  1. Finally enter npm -v. You should see output similar to this to indicate Npm is installed and ready to go:

6.4.1

Installing on Windows

  1. Firstly, download the LTS version NodeJS that can be found here: https://nodejs.org/en/
  2. Once downloaded run the installer and complete the installation steps (You will see that it will mention installing both node and npm).
  3. Once the installation has completed open a command line window (Search for cmd in the Start section) and enter node -v. You should see output similar to this to indicate Node is installed and ready to go:

v10.15.1

  1. Finally enter npm -v. You should see output similar to this to indicate Npm is installed and ready to go:

6.4.1

Frequently asked questions

When I run node -v or npm -v it tells me it’s not recognised

If you have installed NodeJS but are receiving errors in your terminal or command about node or npm not being available it is likely that the environmental variable for your system named PATH is missing details of where your copy of node and/or npm is installed.

You can learn more about updating your environmental variables here: https://www.computerhope.com/issues/ch000549.htm

Comments