DSContEd / IntroWebDevelopment

At the end of the course, students will be able to plan, design, and implement a web site using current standards and best practices.
1 stars 1 forks source link

Environment: What does "npm-start" do? #8

Open TonyGoodDay2 opened 7 years ago

TonyGoodDay2 commented 7 years ago

What does "npm-start" do?

cmitchell74 commented 7 years ago

When you issue the command npm start from the root directory of your nodejs project, node will look for a scripts object in your package.json file. If found, it will look for a script with the key start and run the command specified as its value.

jjsahn commented 7 years ago

This runs an arbitrary command specified in the package's "start" property of its "scripts" object. If no "start" property is specified on the "scripts" object, it will run node server.js . As of npm@2.0.0 , you can use custom arguments when executing scripts.