Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
PoJung Chen5,856 Points
why use "npm start" but not "npm run start"?
In the last video, we use "npm run build" to execute the script. Why we only use "npm start" and npm can still run it?
Take a look at the "scripts" field.
The "scripts" property is a dictionary containing script commands that are run at various times in the lifecycle of your package. The key is the lifecycle event, and the value is the command to run at that point.
See npm-scripts to find out more about writing package scripts.
npm supports the "scripts" property of the package.json script, for the following scripts:
prestart, start, poststart: Run by the npm start command.
You don't have a build task in your scripts field.