'Deployed project successfully, Heroku 503 error when trying to open in web
Was able to push my stack app to Heroku and have it deploy successfully with no error, but when opening the link it gives me a 503 error. I am curious to if I'm missing something in my package.json or my server is setup incorrectly. "heroku logs --tail" was able to show me the error, and the error below says im missing script start. I've checked my script in package.json but I am not missing the start script in my package.json and added the build script in my server package.json to build my React app. My full project is available here:
https://github.com/Pillbug23/caltrails.github.io
2022-02-02T06:07:23.227967+00:00 app[web.1]: npm ERR! Missing script: "start"
2022-02-02T06:07:23.228160+00:00 app[web.1]: npm ERR!
2022-02-02T06:07:23.228451+00:00 app[web.1]: npm ERR! Did you mean one of these?
2022-02-02T06:07:23.228682+00:00 app[web.1]: npm ERR! npm star # Mark your favorite packages
2022-02-02T06:07:23.228922+00:00 app[web.1]: npm ERR! npm stars # View packages marked as favorites
2022-02-02T06:07:23.229031+00:00 app[web.1]: npm ERR!
2022-02-02T06:07:23.229122+00:00 app[web.1]: npm ERR! To see a list of scripts, run:
2022-02-02T06:07:23.229220+00:00 app[web.1]: npm ERR! npm run
2022-02-02T06:07:23.241797+00:00 app[web.1]:
2022-02-02T06:07:23.242242+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2022-02-02T06:07:23.242362+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2022-02-02T06_07_23_230Z-debug.log
2022-02-02T06:07:23.394883+00:00 heroku[web.1]: Process exited with status 1
Solution 1:[1]
Your package.json file is missing the node js version declaration. Heroku would require it when building to target that specific version.
"engines": {
"node": "14.x"
},
See this link for more info. https://devcenter.heroku.com/articles/deploying-nodejs#specify-the-version-of-node
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ayodele |
