[英]I'm unable to run the script through npm run command. My script name is “start”. whenever i run this script through this command i got error
Actually I'm trying to deploy my app to Heroku(it is not about a problem with Heroku).实际上,我正在尝试将我的应用程序部署到 Heroku(这与 Heroku 无关)。 Previously I was running the script on my local machine by just running app.js (script name).
以前我只是通过运行 app.js(脚本名称)在本地机器上运行脚本。 but now I have to modify my packege.json by adding "start":"node src/app.js" script.
但现在我必须通过添加“start”:“node src/app.js”脚本来修改我的packege.json。 But whenever I run the command (npm run start) it generates the error.
但是每当我运行命令(npm run start)时,它都会产生错误。
I have tried "start":"node app.js".我试过“开始”:“节点 app.js”。 I have checked the location of the script correctly it is in the src folder but still is not working.
我已经正确检查了脚本的位置,它位于 src 文件夹中,但仍然无法正常工作。
{
"name": "src",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"start": "node src/app.js" // here I declare the start
},
This script has to start the server此脚本必须启动服务器
You should just need to run npm start
.你应该只需要运行
npm start
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.