Start script missing error in Node.js

You might be familiar with a start script error which looks like this.

npm ERR! Windows_NT6.3.9600 npm ERR! argv "C:\Program Files\nodejs\\node.exe"
"C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start" npm ERR! node v0.12.7 npm ERR! npm v2.11.3
This occurs when you try to debug your application using npm without knowing that you missed the start script in package.json file. If your project doesn't have a server.js file or you don't have start script in your package.json file this error will popup. It will also appear if your package.json file has a second “script” key,in this case remove that script key. A start script looks like given below code snippet.

"scripts": {

"start":"node your-script.js"


You have to add this to package.json file file prevent this error otherwise you can change the name of your application script to server.js. You might think what is the need for start when you have main?. Its because script start is the script that is to be rub by npm when you type npm start command. Main is the entry point into a module when you use require(‘that_module’) to add it in another project.