首页 > 解决方案 > npm scripts won't execute

问题描述

I have set up a few projects with npm, and so far, running 'npm start' in the terminal, or using the npm scripts panel in the VSCode explorer would run and start my apps.

However, the scripts simply don't seem to run anymore, I did no change to the project nor to the Node in my machine, and the problem isn't with my code, as starting my Vue app through the Vue User Interface will work just fine.

In the detail of what happens: I run npm start (which is defined in package.json), the terminal will start the task, and then end with no explanation.

If anyone knows what the purpose of this could be...

terminal print upon executing npm script

package.json print

标签: node.jswebnpmnpm-scripts

解决方案


当您运行 npm start 时,它将根据 package.json 文件运行。在这种情况下,它将运行“电子”。我不确定那应该做什么。

启动脚本的一个示例是:

start: "npm run build && node server.js"

然后它会在你运行“npm start”时运行该脚本。


推荐阅读