This installation guide will walk you through the process of installing Node.js on your personal Mac computer.

What's Node.js?

Node.js is a JavaScript runtime that will allow your computer to execute JavaScript code similar to a web browser.

There are several different versions of Node.js, so they have developed software to help you obtain and switch between versions (which is helpful if you are working on multiple projects). That software is called nvm (Node.js Version Manager). Install that now.

Open a new Terminal window on your Mac and copy/paste the following command. If you are prompted for an administrator password, enter it.

(Copy and paste this entire line - it is word-wrapping in the documentation, but it is a single command.)

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

Quit and restart your Terminal after the installation.

If your code doesn't run or you see an error message, follow the troubleshooting steps listed here.

Verify installation

Ensure that nvm was installed by entering the command:

command -v nvm

This should return the message "nvm". If nothing is returned, quit and restart the Terminal.

If that does not fix the issue, run the curl command again, quit your Terminal, and restart it.

You will now use nvm to install the current stable LTS ("long term support") release of Node.js. Input the following command:

nvm install --lts

Check Node.js version

Verify the version of Node.js that was installed. Run the following command:

node –-version

You should receive a message that "v16.17.0" (or a higher number) is installed.

If you have not already, download and install Visual Studio Code. Choose the correct version for your MacOS and chipset.

You will now allow Visual Studio Code to create a shortcut for launching and loading files in the editor.

Launch Visual Studio Code.

Inside the application, open the Command Palette (Command+Shift+P)

Choose the option Shell Command: Install ‘code' command in PATH and proceed through the dialogs, giving permissions where necessary.

Once this is done, you are finished and ready to continue with our class exercises.