Environment Setup With nvm

Project Source Code

Get the project source code below, and follow along with the lesson material.

Download Project Source Code

To set up the project on your local machine, please follow the directions provided in the README.md file. If you run into any issues with running the project source code, then feel free to reach out to the author in the course's Discord channel.

  • |

Lesson Transcript

  • [00:00 - 00:09] Before we even get started scaffolding our hooks project, we should be sure everyone has the same environment setup. This will ensure that we're all on the same page and that we can all run the same commands.

  • [00:10 - 00:18] Primarily, our environment will consist of Node and NPM. A tool commonly used to manage various Node JS versions is NVM.

  • [00:19 - 00:31] This tool allows us to easily switch between different versions of Node JS. We'll be using NVM to install the latest long-term support or LTS version of Node JS.

  • [00:32 - 01:06] According to the NVM installation documentation, NVM can be installed using CRL or WGet. Now NVM will tell you here to close and reopen your terminal, but since they've just appended to your Shell's profile, we can just run the following command to reload the profile. Since I'm using Z SH, I would run Source, then Tilda for the home directory, and then .zshrc. If you're using Bash, you would likely have to source the .

  • [01:07 - 01:27] bashrc file, or perhaps even .bash_profile. You can check that NVM was properly installed and sourced by issuing the following command, NVM list. You should see a list of installed versions of Node JS, and by default, there should be at least one installed.

  • [01:28 - 01:43] As of this lesson, the latest LTS version of Node JS is version 16.18.1. We can install this version of Node JS using the following command. NVM install 16.18.1.

  • [01:44 - 01:56] Since we'll be using this throughout the rest of this course, let's alias it as our default version of Node JS. We can do that with NVM alias default 16.18.1.

  • [01:57 - 02:13] This means every time you open up a new terminal, NVM will take the Node JS version 16.18.1 for you. To double-check that NVM is doing its job, we can simply open a new terminal here, and issue Node-V.

  • [02:14 - 02:23] And we, of course, get the output we expect, 16.18.1. So in summary, we installed NVM as the readme on their GitHub suggests.

  • [02:24 - 02:35] We installed the latest LTS version of Node JS, version 16.18.1. And we set this version as our default version of Node to use via NVM default.

  • [02:36 - 02:38] In the next lesson, we'll begin scaffolding our project.