Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Share On Stumbleupon
Contact us
Hide Buttons

What does npm start do in nodejs

When you issue the com­mand npm start from the root direc­tory 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 com­mand spec­i­fied as its value.

If your package.json does not have any scripts object or if the scripts object does not have a start key, it will run the com­mand node server.js instead.

Npm scripts are pretty use­ful because they let you group together and run log­i­cally related com­mands. e.g. lin­ters, mini­fiers etc.

If you are unfa­mil­iar with package.json, here’s a nifty lit­tle inter­ac­tive expla­na­tion of its dif­fer­ent parts. Check it out!

Ryan Sukale

Ryan is just a regular guy next door trying to manage his life and finances.

You may also like...