-
Notifications
You must be signed in to change notification settings - Fork 35
Fall 2026
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:
- Syncing your forked repo -- What to do when I make updates to the course repository
- Syncing your local repo -- What to do when you make some changes on GitHub and want those changes locally
- Installing dependencies -- How to use NPM to install packages listed in a project
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.
You can pull the changes that I made into your repo by going over to the Sync fork button and choosing Update branch.
After you do that, the banner at the top should say that your branch is "up to date".
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).
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.
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).
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:

After npm install:

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