Home >Web Front-end >Front-end Q&A >What to do if node start reports an error
Node start error solution: 1. Execute "node xx.js" directly in the terminal; 2. Add the start startup item "scripts": {"test": "echo \"Error: no test specified\" && exit 1","start":"node service.js"}"; 3. Execute "npm start" again.
The operating environment of this tutorial: Windows 10 system, node v7.6.0 version, Dell G3 computer.
node start What should I do if I get an error?
The node terminal executes npm start and an error "npm ERR! missing script: start" appears
Open package.json with the following content
"scripts": { "test": "echo \"Error: no test specified\" && exit 1" }
There are two solutions.
1. Execute node xx.js directly in the terminal
xx.js is the file you want to execute
2. Add the start startup item
"scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start":"node service.js" }
Then execute npm start and it will be executed successfully
Recommended learning: "node.js video tutorial"
The above is the detailed content of What to do if node start reports an error. For more information, please follow other related articles on the PHP Chinese website!