While it's important to practice installing dependencies with npm and manually setting up a
package.json file, it would be painful to have to do this for every project. As long as the root directory of a project contains a
package.json file that lists all the packages we'll need, we can just run
$ npm install to get our project up and running.
Here is our
shape-tracker repository so far:
Make sure that you are referencing the code from the branch called
1_functioning_environment. This is the default branch, so running
git clone... with the url of the repo home page will automatically clone down the branch called
1_functioning_environment. As needed, review the lesson on accessing code from different branches. Don't forget you can also download the code by clicking Download ZIP.
Everything in this configuration is reusable for future projects. However, we recommend setting up your configuration from scratch for at least a few projects. This will give you more experience with setting up a development environment.
Note: The project above was set up on a Mac machine. If you are using a Windows machine, running two commands in one script with a ';' won't work. We'll instead need to join the two with "&" like this:
"start": "npm run build & webpack-dev-server --open --mode development".
One last thing: you should always specify the project name and author when reusing a
Lesson 20 of 43
Last updated October 18, 2021