2016-06-06 7 views
0

heroku에 처음 왔고 node.js 앱을 처음 실행할 때 애플리케이션 오류가 발생합니다. 프로그램이 로컬에서 제대로 실행되기 때문에 정확하게 문제가 무엇인지 식별하는데 어려움이 있습니다. 여기에 로그가 있습니다. 필요하다면 나는 Node.js를 코드를 게시 할 수 있지만, specfically 나는 Node.js Heroku App 응용 프로그램 오류입니다. 로그 문제.

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

가되어야합니다 알고 당신은 다음과 같이 당신의 package.json에 시작 스크립트를 추가 할 수 있습니다

2016-06-06T23:38:54.950995+00:00 heroku[api]: Release v2 created by [email protected] 
2016-06-06T23:38:54.950923+00:00 heroku[api]: Enable Logplex by [email protected] 
2016-06-06T23:39:20.282705+00:00 heroku[api]: Scale to web=1 by [email protected] 
2016-06-06T23:39:20.283517+00:00 heroku[api]: Deploy 5244c81 by [email protected] 
2016-06-06T23:39:20.283586+00:00 heroku[api]: Release v3 created by [email protected] 
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= 
+0

package.json을 게시하십시오. 내 생각 엔 당신이 정확하게 시작 스크립트를 지정하지 않는다고 생각합니다. – user2263572

+0

게시 한 오류 로그에 따르면'package.json' 파일에'start' 스크립트가 없습니다 https://github.com/heroku/node-js-getting-started/blob/master/package.json – gevorg

+0

{ "이름": "소켓 - 예를 들어 채팅", "버전": "0.0.1", "설명": "처음 socket.io 응용 프로그램", "종속": { "표현" : "~ 4.10.2", "socket.io": "1.2.0", } } 어떻게 해결하겠습니까? –

답변

2

권리 :

"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", } 
} 
관련 문제