Actually I'm trying to deploy my app to Heroku(it is not about a problem with Heroku). Previously I was running the script on my local machine by just running app.js (script name). but now I have to modify my packege.json by adding "start":"node src/app.js" script. But whenever I run the command (npm run start) it generates the error.
I have tried "start":"node app.js". I have checked the location of the script correctly it is in the src folder but still is not working.
{
"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
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.