Be the first user to complete this post

  • 0
Add to List

What does npm start do in nodejs

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. 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 command node server.js instead. Npm scripts are pretty useful because they let you group together and run logically related commands. e.g. linters, minifiers etc.

If you are unfamiliar with package.json, here's a nifty little interactive explanation of its different parts. Check it out!

Also Read:

  1. Find the environment variables of a nodejs process in linux
  2. Setup passportjs for local authentication and authorization using expressjs
  3. Debugging nodejs applications using node-inspector and Chrome Dev Tools
  4. Dynamic module loading with require
  5. Unit test your Nodejs RESTful API using mocha
  6. Understanding nodejs module exports and require
  7. Installing, Listing and Uninstalling packages using npm
  8. Configuring jshint as a pre-commit hook for your nodejs applications