Missing Script Start

醉酒当歌 提交于 2019-12-11 14:52:49

问题


I'm trying to run this example. I have these errors when I start running it:

npm ERR! missing script: start

npm ERR! A complete log of this run can be found in:

npm ERR!/home/username/.npm/_logs/2018-04-15T09_19_49_453Z-debug.log

any help?


回答1:


your scripts of package.json should be:

  "scripts": {
    "start": "node ./examples/app.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  }



回答2:


It looks like there is no start command in scripts i.e in your package.json file. Below is the start command you need to add to your scripts in package.json file, if it is not available.

"scripts": {
    "start": "node your-script.js"
}

Or you could directly run the following command

node your-script.js

This error can also occur if there is a second entry of script key in your package.json file, try removing the second entry and run it works.




回答3:


As above, make sure that you have your start scripts.

"scripts": {
"start": "node ./examples/app.js",
"test": "echo \"Error: no test specified\" && exit 1"
 }

Also, make sure that you are in the correct client side of the application when running npm start.



来源:https://stackoverflow.com/questions/49840457/missing-script-start

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!