Pre-Course Setup

Complete the following setup so you can do the course exercises. It should take less than 15 minutes.

1. Download the code

  1. Install git, if you don’t already have it installed.
  2. Install Node.js v18.16.0.
  3. Download the source code repository and unzip it. This is the origin repo. You won’t be working out of these files.
  4. Clone the origin repo into a convenient folder. This folder is the working directory you’ll be coding in.
    git clone --config core.autocrlf=false <path_to_origin_repo> <path_to_working_directory>

2. Test the build

  1. Open a command prompt and navigate to the working directory.
  2. Run the self-check script. It will check out all the exercise branches and make sure they build. It will take about a minute, maybe two.
    • Windows: .\self_check.cmd
    • Mac/Linux: ./self_check.sh
  3. Confirm that the script ends with SELF-CHECK OK.
    • If it doesn’t, make sure you have the correct version of Node.js installed. There will be a warning banner if you don’t.

3. Test the watch script

  1. Open a command prompt and navigate to the working directory.
  2. Run the watch script.
    • Windows: .\watch.cmd quick
    • Mac/Linux: ./watch.sh quick
  3. Confirm that the script says BUILD OK. On Mac and Windows, it should also play a sound.
  4. Make a change to a source file, such as src/serve.js, and save it.
  5. Confirm that the script runs the build again.

If the build times out:

  1. Edit build/scripts/watch.js and change the TIMEOUT_IN_MS constant at the top of the file.

If the sounds cause problems, or if you just don’t like them:

  1. Edit build/scripts/watch.js and change the PLAY_SOUNDS constant at the top of the file.

That’s it!

Return to course overview