0

I was pushing my backend app into heroku and the terminal stated that the build was successful, but when I opened the app on heroku, I got an Application Error. I didn't know why I got the error so I checked the logs to see what went wrong and I got this error

npm ERR! missing script: start

I looked into my package.json file to see if I was missing the script which I did so I added it, saved it, and tried again. But I got the same error again.

2021-04-14T19:18:04.356291+00:00 heroku[web.1]: State changed from crashed to starting
2021-04-14T19:18:07.961166+00:00 heroku[web.1]: Starting process with command `npm start`
2021-04-14T19:18:12.111161+00:00 app[web.1]:
2021-04-14T19:18:12.111313+00:00 app[web.1]: > server@1.0.0 start /app
2021-04-14T19:18:12.111314+00:00 app[web.1]: > react-scripts start
2021-04-14T19:18:12.111315+00:00 app[web.1]:
2021-04-14T19:18:12.157403+00:00 app[web.1]: sh: 1: react-scripts: not found
2021-04-14T19:18:12.187222+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-04-14T19:18:12.187951+00:00 app[web.1]: npm ERR! syscall spawn
2021-04-14T19:18:12.188363+00:00 app[web.1]: npm ERR! file sh
2021-04-14T19:18:12.188819+00:00 app[web.1]: npm ERR! errno ENOENT
2021-04-14T19:18:12.211062+00:00 app[web.1]: npm ERR! server@1.0.0 start: `react-scripts start`
2021-04-14T19:18:12.211646+00:00 app[web.1]: npm ERR! spawn ENOENT
2021-04-14T19:18:12.211937+00:00 app[web.1]: npm ERR!
2021-04-14T19:18:12.212241+00:00 app[web.1]: npm ERR! Failed at the server@1.0.0 start script.
2021-04-14T19:18:12.212466+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-04-14T19:18:12.244478+00:00 app[web.1]:
2021-04-14T19:18:12.244849+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-04-14T19:18:12.245079+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-04-14T19_18_12_213Z-debug.log
2021-04-14T19:18:12.357679+00:00 heroku[web.1]: Process exited with status 1
2021-04-14T19:18:12.594377+00:00 heroku[web.1]: State changed from starting to crashed
2021-04-14T19:18:12.599011+00:00 heroku[web.1]: State changed from crashed to starting
2021-04-14T19:18:16.455528+00:00 heroku[web.1]: Starting process with command `npm start`
2021-04-14T19:18:21.190579+00:00 app[web.1]:
2021-04-14T19:18:21.190596+00:00 app[web.1]: > server@1.0.0 start /app
2021-04-14T19:18:21.190596+00:00 app[web.1]: > react-scripts start
2021-04-14T19:18:21.190597+00:00 app[web.1]:
2021-04-14T19:18:21.195064+00:00 app[web.1]: sh: 1: react-scripts: not found
2021-04-14T19:18:21.239863+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-04-14T19:18:21.240485+00:00 app[web.1]: npm ERR! syscall spawn
2021-04-14T19:18:21.240777+00:00 app[web.1]: npm ERR! file sh
2021-04-14T19:18:21.245432+00:00 app[web.1]: npm ERR! errno ENOENT
2021-04-14T19:18:21.267264+00:00 app[web.1]: npm ERR! server@1.0.0 start: `react-scripts start`
2021-04-14T19:18:21.267431+00:00 app[web.1]: npm ERR! spawn ENOENT
2021-04-14T19:18:21.267617+00:00 app[web.1]: npm ERR!
2021-04-14T19:18:21.267784+00:00 app[web.1]: npm ERR! Failed at the server@1.0.0 start script.
2021-04-14T19:18:21.267934+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-04-14T19:18:21.300101+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-04-14T19:18:21.300254+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-04-14T19_18_21_269Z-debug.log
2021-04-14T19:18:21.457696+00:00 heroku[web.1]: Process exited with status 1
2021-04-14T19:18:21.562219+00:00 heroku[web.1]: State changed from starting to crashed

I don't know what the problem is now cause I added the script but I keep getting the same error.

Here's my package.json for proof

"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "react-scripts start"
  },
AmmanM
  • 97
  • 7

0 Answers0