Setting up the PATH

 

What is the PATH?

When you open up a terminal like PowerShell there are certain programs that are available no matter what directory you're inside. Eg. cat and ls These commands can be executed even inside of an empty directory.

 

These commands aren't actually built into the terminal, they are actually a collection of programs. The terminal itself checks a predefined list of directories called the $PATH for programs and makes sure each of those programs in the path are globally accessible no matter what directory you are currently inside.

 

You can add your own programs to this list by configuring this path variable.

 

Setting up the Path

In the windows search bar type environment and choose Edit the System environment variables

 

path-1

 

Choose Environment Variables

path-2

 

There are two choices for the Path variable, one will be under User variables, the other under System variables. You can choose either one the difference being User variables are tied to your individual account, where as System variables are tied to the entire computer (spread across all accounts).

If you don't have a personal preference System Variables are easier to work with.

 

path-3

 

Click Path, then Edit

Check to see if you have a record for nodejs like below:

 

path-4

 

If it exists verify that the directory is pointing to your nodejs installation (and if it's not update it to the correct location with Edit.)

If you don't have a record click New and type in the path to your nodejs installation

Typically C:\Program Files\nodejs but verify yourself first (by navigating to that directory and verifying there exists a program node.exe)

 

path-5

 

You should be good 👍

Restart your terminal and the node program should be available!