问题
15:05:09 web.1 | started with pid 4888
15:05:10 web.1 |
15:05:10 web.1 | > finext_server@0.0.1 test F:\Projects\finext\server
15:05:10 web.1 | > set NODE_ENV=development && node ./bin/www.js
15:05:11 web.1 |
15:05:12 web.1 | exited with code 5
15:05:12 system | sending SIGKILL to all processes
15:05:12 | app.get('env'): development
This is the output I get, and it is a little variable in terms of the code that gets executed after SIGKILL. Sometimes, a few more lines of coide get executed before I see the command prompt again.
I tried using node-foreman, and my application works fine there. So i am guessing it has something to do with foreman. My code and procfile can be found here: https://github.com/chintanp/finext
This is the reason that the process cannot start on heroku as well.
Someone in another world had a similar problem. Express Hello World -- Heroku Foreman Returns Code 5, 'npm start' works just fine
回答1:
In Procfile try this:
web: node app.js
回答2:
I recently faced exactly the same situation as you when running my application:
foreman logged the messages "exited with code 5" and "sending SIGKILL to all processes".
My app worked fine if I used npm ("npm start") or node-foreman ("nf start") instead of foreman.
The app also worked using forego, a go application written by the author of foreman.
But a couple of weeks ago heroku added the new command "heroku local", which uses forego behind the scenes, and formally supersedes the use of foreman:
Starting today, new Heroku Toolbelt installs will not come with Foreman. The command heroku local has replaced foreman. Heroku Local makes use of Forego to accomplish its tasks and it’s faster and has better cross-platform support.
Note that heroku also now state that foreman is "not officially supported".
So the way to resolve your problem is:
Stop using foreman.
Download and install the latest version of heroku toolbelt.
Replace "foreman start" with "heroku local".
This approach worked for me on Windows 7.
来源:https://stackoverflow.com/questions/30346081/heroku-foreman-exits-with-an-error-code-5