簡體   English   中英

Node.js Heroku App應用程序錯誤。 日志問題

[英]Node.js Heroku App application error. Trouble with logs

我是heroku的新手,第一次運行node.js應用程序時,出現應用程序錯誤。 由於該程序在本地運行良好,因此我很難確定問題出在哪里。 這是日志。 如果需要,我可以發布node.js代碼,但是我知道

http.listen(process.env.PORT || 3000, function(){
console.log('listening on *:3000');
});

應該是對的

2016-06-06T23:38:54.950995+00:00 heroku[api]: Release v2 created by 96benchu@gmail.com
2016-06-06T23:38:54.950923+00:00 heroku[api]: Enable Logplex by 96benchu@gmail.com
2016-06-06T23:39:20.282705+00:00 heroku[api]: Scale to web=1 by 96benchu@gmail.com
2016-06-06T23:39:20.283517+00:00 heroku[api]: Deploy 5244c81 by 96benchu@gmail.com
2016-06-06T23:39:20.283586+00:00 heroku[api]: Release v3 created by 96benchu@gmail.com
2016-06-06T23:39:20.707206+00:00 heroku[slug-compiler]: Slug compilation started
2016-06-06T23:39:20.707211+00:00 heroku[slug-compiler]: Slug compilation finished
2016-06-06T23:39:22.230869+00:00 heroku[web.1]: Starting process with command `npm start`
2016-06-06T23:39:24.373251+00:00 app[web.1]: npm ERR! Linux 3.13.0-85-generic
2016-06-06T23:39:24.373791+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-06-06T23:39:24.374028+00:00 app[web.1]: npm ERR! node v5.11.1
2016-06-06T23:39:24.374471+00:00 app[web.1]: npm ERR! npm  v3.8.6
2016-06-06T23:39:24.375629+00:00 app[web.1]:
2016-06-06T23:39:24.376442+00:00 app[web.1]: npm ERR! missing script: start
2016-06-06T23:39:24.376571+00:00 app[web.1]: npm ERR!
2016-06-06T23:39:24.376669+00:00 app[web.1]: npm ERR! If you need help, you may report this error at:
2016-06-06T23:39:24.376763+00:00 app[web.1]: npm ERR!     <https://github.com/npm/npm/issues>
2016-06-06T23:39:24.384251+00:00 app[web.1]:
2016-06-06T23:39:24.384417+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-06-06T23:39:24.384520+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2016-06-06T23:39:25.117419+00:00 heroku[web.1]: State changed from starting to crashed
2016-06-06T23:39:25.118722+00:00 heroku[web.1]: State changed from crashed to starting
2016-06-06T23:39:25.105763+00:00 heroku[web.1]: Process exited with status 1
2016-06-06T23:39:26.845316+00:00 heroku[web.1]: Starting process with command `npm start`
2016-06-06T23:39:30.360228+00:00 app[web.1]: npm ERR! Linux 3.13.0-85-generic
2016-06-06T23:39:30.360970+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-06-06T23:39:30.361314+00:00 app[web.1]: npm ERR! node v5.11.1
2016-06-06T23:39:30.362144+00:00 app[web.1]: npm ERR! npm  v3.8.6
2016-06-06T23:39:30.364140+00:00 app[web.1]:
2016-06-06T23:39:30.365320+00:00 app[web.1]: npm ERR! missing script: start
2016-06-06T23:39:30.365478+00:00 app[web.1]: npm ERR!
2016-06-06T23:39:30.365600+00:00 app[web.1]: npm ERR! If you need help, you may report this error at:
2016-06-06T23:39:30.365735+00:00 app[web.1]: npm ERR!     <https://github.com/npm/npm/issues>
2016-06-06T23:39:30.381812+00:00 app[web.1]:
2016-06-06T23:39:30.382074+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-06-06T23:39:30.382233+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2016-06-06T23:39:31.427206+00:00 heroku[web.1]: State changed from starting to crashed
2016-06-06T23:39:31.409170+00:00 heroku[web.1]: Process exited with status 1
2016-06-06T23:40:10.611044+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=secret-eyrie-35026.herokuapp.com request_id=9e530180-b522-4412-a321-54b90430b82f fwd="172.6.205.107" dyno= connect= service= status=503 bytes=
2016-06-06T23:40:11.404313+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=secret-eyrie-35026.herokuapp.com request_id=f039df37-b206-41df-80b8-5076330ae67f fwd="172.6.205.107" dyno= connect= service= status=503 bytes=
2016-06-06T23:41:02.960874+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=secret-eyrie-35026.herokuapp.com request_id=0ad763f1-7a6f-4324-b9ad-f81891d4ccba fwd="172.6.205.107" dyno= connect= service= status=503 bytes=
2016-06-06T23:41:03.729436+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=secret-eyrie-35026.herokuapp.com request_id=790a0e38-360c-447d-80a6-fa57914faf15 fwd="172.6.205.107" dyno= connect= service= status=503 bytes=

您可以在package.json中添加啟動腳本,如下所示:

"scripts": {
    "start": "node index.js"
},

這樣您的package.json將如下所示:

{ 
    "name": "socket-chat-example", 
    "version": "0.0.1", 
    "description": "my first socket.io app", 
    "scripts": {
        "start": "node index.js"
    },
    "dependencies": { "express": "~4.10.2", "socket.io": "1.2.0", } 
} 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM