Skip to content

Fall 2026

Mjumbe Poe edited this page Sep 3, 2026 · 5 revisions

Week 02 Updates After Class

There are a couple of things that I realized I didn't do in class. While I was up front, I noticed that the code I was writing wasn't being linted, but I neglected to investigate why. As a result, I did not show how to make sure that my linters were actually set up.

Below, there are a few things that I'll show:

  1. Syncing your forked repo -- What to do when I make updates to the course repository
  2. Syncing your local repo -- What to do when you make some changes on GitHub and want those changes locally
  3. Installing dependencies -- How to use NPM to install packages listed in a project

Syncing your forked repo

Why: occasionally there may be changes that I've made in my copy of the code that might be worthwhile to merge into your copies (I'll remember to tell you when that happens in the future).

If you open your fork of intro-js-exercises on GitHub in the browser and see a banner that says that your branch is "1 commit behind" (maybe more), that means there are changes that I made to the upstream repository after you forked the repo.

Screenshot From 2026-09-02 23-13-08

You can pull the changes that I made into your repo by going over to the Sync fork button and choosing Update branch.

Screenshot From 2026-09-02 23-13-13

After you do that, the banner at the top should say that your branch is "up to date".

Screenshot From 2026-09-02 23-13-23

Syncing your local repo

Why: Syncing your code on GitHub with the course repository updates the code in your account, but not on your local computer; you still have to pull those changes down from your account.

You'll want to go into VS Code or GitHub Desktop to download the updates to your local clone. Using VS Code, I do this by going to the Source Control tab, opening the menu, selecting Fetch, and then clicking the Sync Changes button (or I could both fetch and sync at the same time by selecting the Pull menu option).

Screenshot From 2026-09-02 23-13-52 Screenshot From 2026-09-02 23-14-03

Installing dependencies

Why: Many JavaScript project authors will include a file that lists all the packages that are needed to work with or run the code in that project. There are, thankfully, standard ways to install those packages (known as "dependencies").

Now that you've downloaded all the changes I made upstream, you can install the repository dependencies. These are usually listed in the package.json file.

Screenshot From 2026-09-02 23-14-18

If you open a terminal in the project's folder and run npm install (assuming you have node and npm installed), NPM will read those dependencies from the package.json file and install the packages.

There are a few ways to open a terminal in VS Code. You can use the Terminal menu, or you can search for "terminal new" in the super menu, or you can use the shortcut key (which you can see on the right side in the super menu).

Screenshot From 2026-09-02 23-14-35 Screenshot From 2026-09-02 23-14-47

Once npm install completes you will have a new folder in your repository named node_modules. This is a self-contained space where NPM installs project dependencies. You should almost never commit what's in node_modules into your repository.

Before npm install: Screenshot From 2026-09-02 23-15-04

After npm install: Screenshot From 2026-09-02 23-15-13

Now, with the dependencies (like eslint) installed, VS Code should be able to show you linter issues in line.

Screenshot From 2026-09-02 23-15-33

Clone this wiki locally