2014-12-29 4 views
0

내 응용 프로그램을 Heroku로 푸시하는 방법을 알아 내려고했습니다. 방금 Node.js 튜토리얼을 성공적으로 수행 했으므로 npm installforeman start을 사용하여 로컬로 내 응용 프로그램을 제대로 실행할 수 있었지만 Heruko 사이트에서 푸시하려고 시도 할 때 오류가있는 것으로 가정합니다. 뭔가를 설치하지만 로그를 잘 판독 할 수는 없습니다.응용 프로그램 오류 Heroku - 배포 관련 문제

내 기록은 다음과 같습니다. (힘내, NodeJS 및 Heruko 새로운 참고로, 정말 미안 내가 분명 뭔가 놓친 경우) 응용 프로그램이 connect-livereload 모듈을로드하는 데 실패처럼 보이는

$ heroku logs --tail 
←[36m2014-12-29T15:38:08.188615+00:00 app[web.1]:←[0m npm ERR! There is likely additional logging output above. 
←[36m2014-12-29T15:38:08.188812+00:00 app[web.1]:←[0m npm ERR! System Linux 3.8.11-ec2 
←[36m2014-12-29T15:38:08.897061+00:00 heroku[web.1]:←[0m Process exited with status 1 
←[36m2014-12-29T15:38:08.916161+00:00 heroku[web.1]:←[0m State changed from starting to crashed 
←[33m2014-12-29T15:38:29.680490+00:00 heroku[api]:←[0m Scale to web=1 by myEmail.com 
←[32m2014-12-29T15:38:36.597146+00:00 heroku[router]:←[0m at=error code=H10 desc="App crashed" method=GET path="/" host=still-anchorage-3610.herokuapp.com request_id=36191235-65e4-441e-9cfa-9498182d1834 fwd="64.255.74.231" dyno= connect= service= status=503 bytes= 
←[32m2014-12-29T15:38:36.810592+00:00 heroku[router]:←[0m at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=still-anchorage-3610.herokuapp.com request_id=10f03d06-42d1-4119-999a-8337a8651222 fwd="64.255.74.231" dyno= connect= service= status=503 bytes= 
←[32m2014-12-29T15:38:40.082568+00:00 heroku[router]:←[0m at=error code=H10 desc="App crashed" method=GET path="/" host=still-anchorage-3610.herokuapp.com request_id=86f49b1b-d70f-444c-9927-4695b6b34e89 fwd="64.255.74.231" dyno= connect= service= status=503 bytes= 
←[32m2014-12-29T15:38:40.354619+00:00 heroku[router]:←[0m at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=still-anchorage-3610.herokuapp.com request_id=38a9fb83-f441-4752-a1e9-e271db850383 fwd="64.255.74.231" dyno= connect= service= status=503 bytes= 
←[32m2014-12-29T15:38:43.300739+00:00 heroku[router]:←[0m at=error code=H10 desc="App crashed" method=GET path="/" host=still-anchorage-3610.herokuapp.com request_id=d579a34f-fb80-4cae-b33e-aa80f3850a69 fwd="64.255.74.231" dyno= connect= service= status=503 bytes= 
←[32m2014-12-29T15:38:43.574003+00:00 heroku[router]:←[0m at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=still-anchorage-3610.herokuapp.com request_id=91f015a4-ee68-4e2e-b40f-49e47fbf0d99 fwd="64.255.74.231" dyno= connect= service= status=503 bytes= 
←[33m2014-12-29T16:03:09.011875+00:00 heroku[api]:←[0m Scale to web=1 by myEmail.com 
←[32m2014-12-29T16:03:15.311197+00:00 heroku[router]:←[0m at=error code=H10 desc="App crashed" method=GET path="/" host=still-anchorage-3610.herokuapp.com request_id=c6f7e40a-c7ac-4d68-9aa7-f3341a6cc098 fwd="64.255.74.231" dyno= connect= service= status=503 bytes= 
←[32m2014-12-29T16:03:15.594058+00:00 heroku[router]:←[0m at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=still-anchorage-3610.herokuapp.com request_id=18a62541-e33a-4781-be06-045abe145879 fwd="64.255.74.231" dyno= connect= service= status=503 bytes= 
←[33m2014-12-29T16:09:16.117810+00:00 heroku[api]:←[0m Release v4 created by myEmail.com 
←[33m2014-12-29T16:09:16.117779+00:00 heroku[api]:←[0m Deploy c90771b by myEmail.com 
←[36m2014-12-29T16:09:16.683226+00:00 heroku[web.1]:←[0m State changed from crashed to starting 
←[36m2014-12-29T16:09:18.193386+00:00 heroku[web.1]:←[0m Starting process with command `node server/app.js` 
←[36m2014-12-29T16:09:19.314638+00:00 app[web.1]:←[0m module.js:340 
←[36m2014-12-29T16:09:19.316610+00:00 app[web.1]:←[0m at Function.Module._load (module.js:280:25) 
←[36m2014-12-29T16:09:19.316611+00:00 app[web.1]:←[0m at Module.require (module.js:364:17) 
←[36m2014-12-29T16:09:19.316613+00:00 app[web.1]:←[0m at require (module.js:380:17) 
←[36m2014-12-29T16:09:19.316615+00:00 app[web.1]:←[0m at module.exports (/app/server/config/express.js:38:13) 
←[36m2014-12-29T16:09:19.316617+00:00 app[web.1]:←[0m at Object.<anonymous> (/app/server/app.js:15:28) 
←[36m2014-12-29T16:09:19.314316+00:00 app[web.1]:←[0m 
←[36m2014-12-29T16:09:19.314898+00:00 app[web.1]:←[0m throw err; 
←[36m2014-12-29T16:09:19.314906+00:00 app[web.1]:←[0m   ^
←[36m2014-12-29T16:09:19.316618+00:00 app[web.1]:←[0m at Module._compile (module.js:456:26) 
←[36m2014-12-29T16:09:19.316620+00:00 app[web.1]:←[0m at Object.Module._extensions..js (module.js:474:10) 
←[36m2014-12-29T16:09:19.316621+00:00 app[web.1]:←[0m at Module.load (module.js:356:32) 
←[36m2014-12-29T16:09:19.316608+00:00 app[web.1]:←[0m at Function.Module._resolveFilename (module.js:338:15) 
←[36m2014-12-29T16:09:19.316605+00:00 app[web.1]:←[0m Error: Cannot find module 'connect-livereload' 
←[36m2014-12-29T16:09:19.316623+00:00 app[web.1]:←[0m at Function.Module._load (module.js:312:12) 
←[36m2014-12-29T16:09:20.357443+00:00 heroku[web.1]:←[0m Process exited with status 8 
←[36m2014-12-29T16:09:20.375389+00:00 heroku[web.1]:←[0m State changed from crashed to starting 
←[36m2014-12-29T16:09:20.374306+00:00 heroku[web.1]:←[0m State changed from starting to crashed 
←[36m2014-12-29T16:09:22.796156+00:00 heroku[web.1]:←[0m Starting process with command `node server/app.js` 
←[36m2014-12-29T16:09:23.802405+00:00 app[web.1]:←[0m 
←[36m2014-12-29T16:09:23.803009+00:00 app[web.1]:←[0m throw err; 
←[36m2014-12-29T16:09:23.803010+00:00 app[web.1]:←[0m   ^
←[36m2014-12-29T16:09:23.804497+00:00 app[web.1]:←[0m Error: Cannot find module 'connect-livereload' 
←[36m2014-12-29T16:09:23.803003+00:00 app[web.1]:←[0m module.js:340 
←[36m2014-12-29T16:09:23.804500+00:00 app[web.1]:←[0m at Function.Module._resolveFilename (module.js:338:15) 
←[36m2014-12-29T16:09:23.804501+00:00 app[web.1]:←[0m at Function.Module._load (module.js:280:25) 
←[36m2014-12-29T16:09:23.804504+00:00 app[web.1]:←[0m at require (module.js:380:17) 
←[36m2014-12-29T16:09:23.804503+00:00 app[web.1]:←[0m at Module.require (module.js:364:17) 
←[36m2014-12-29T16:09:23.804507+00:00 app[web.1]:←[0m at Object.<anonymous> (/app/server/app.js:15:28) 
←[36m2014-12-29T16:09:23.804508+00:00 app[web.1]:←[0m at Module._compile (module.js:456:26) 
←[36m2014-12-29T16:09:23.804509+00:00 app[web.1]:←[0m at Object.Module._extensions..js (module.js:474:10) 
←[36m2014-12-29T16:09:23.804512+00:00 app[web.1]:←[0m at Function.Module._load (module.js:312:12) 
←[36m2014-12-29T16:09:23.804511+00:00 app[web.1]:←[0m at Module.load (module.js:356:32) 
←[36m2014-12-29T16:09:23.804506+00:00 app[web.1]:←[0m at module.exports (/app/server/config/express.js:38:13) 
←[36m2014-12-29T16:09:24.510417+00:00 heroku[web.1]:←[0m Process exited with status 8 
←[36m2014-12-29T16:09:24.535039+00:00 heroku[web.1]:←[0m State changed from starting to crashed 
←[32m2014-12-29T16:09:25.516484+00:00 heroku[router]:←[0m at=error code=H10 desc="App crashed" method=GET path="/" host=still-anchorage-3610.herokuapp.com request_id=435a24d0-3242-439b-9646-f9a754d0a0f1 fwd="64.255.74.231" dyno= connect= service= status=503 bytes= 
←[32m2014-12-29T16:09:25.835724+00:00 heroku[router]:←[0m at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=still-anchorage-3610.herokuapp.com request_id=b0ea9325-dbc1-4001-b0d3-fc228043bf55 fwd="64.255.74.231" dyno= connect= service= status=503 bytes= 
←[33m2014-12-29T16:11:13.788307+00:00 heroku[api]:←[0m Scale to web=1 by myEmail.com 
←[32m2014-12-29T16:23:05.892581+00:00 heroku[router]:←[0m at=error code=H10 desc="App crashed" method=GET path="/" host=still-anchorage-3610.herokuapp.com request_id=3965fe7b-4155-49cf-81c8-56e20fe10ce3 fwd="64.255.74.231" dyno= connect= service= status=503 bytes= 
←[32m2014-12-29T16:23:06.183875+00:00 heroku[router]:←[0m at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=still-anchorage-3610.herokuapp.com request_id=abdfb4e3-fc6c-4a18-85d0-4fb1653e0040 fwd="64.255.74.231" dyno= connect= service= status=503 bytes= 
←[33m2014-12-29T16:24:17.858493+00:00 heroku[api]:←[0m Deploy 461491a by myEmail.com 
←[33m2014-12-29T16:24:17.858493+00:00 heroku[api]:←[0m Release v5 created by myEmail.com 
←[36m2014-12-29T16:24:17.984165+00:00 heroku[web.1]:←[0m State changed from crashed to starting 
←[36m2014-12-29T16:24:20.032515+00:00 heroku[web.1]:←[0m Starting process with command `node server/app.js` 
←[36m2014-12-29T16:24:21.011870+00:00 app[web.1]:←[0m module.js:340 
←[36m2014-12-29T16:24:21.012416+00:00 app[web.1]:←[0m   ^
←[36m2014-12-29T16:24:21.014369+00:00 app[web.1]:←[0m Error: Cannot find module 'connect-livereload' 
←[36m2014-12-29T16:24:21.012169+00:00 app[web.1]:←[0m throw err; 
←[36m2014-12-29T16:24:21.014372+00:00 app[web.1]:←[0m at Function.Module._resolveFilename (module.js:338:15) 
←[36m2014-12-29T16:24:21.014375+00:00 app[web.1]:←[0m at Module.require (module.js:364:17) 
←[36m2014-12-29T16:24:21.011468+00:00 app[web.1]:←[0m 
←[36m2014-12-29T16:24:21.014382+00:00 app[web.1]:←[0m at Module._compile (module.js:456:26) 
←[36m2014-12-29T16:24:21.014383+00:00 app[web.1]:←[0m at Object.Module._extensions..js (module.js:474:10) 
←[36m2014-12-29T16:24:21.014385+00:00 app[web.1]:←[0m at Module.load (module.js:356:32) 
←[36m2014-12-29T16:24:21.014386+00:00 app[web.1]:←[0m at Function.Module._load (module.js:312:12) 
←[36m2014-12-29T16:24:21.014377+00:00 app[web.1]:←[0m at require (module.js:380:17) 
←[36m2014-12-29T16:24:21.014374+00:00 app[web.1]:←[0m at Function.Module._load (module.js:280:25) 
←[36m2014-12-29T16:24:21.014379+00:00 app[web.1]:←[0m at module.exports (/app/server/config/express.js:38:13) 
←[36m2014-12-29T16:24:21.014380+00:00 app[web.1]:←[0m at Object.<anonymous> (/app/server/app.js:15:28) 
←[36m2014-12-29T16:24:21.799791+00:00 heroku[web.1]:←[0m Process exited with status 8 
←[36m2014-12-29T16:24:21.808150+00:00 heroku[web.1]:←[0m State changed from starting to crashed 
←[36m2014-12-29T16:24:21.808844+00:00 heroku[web.1]:←[0m State changed from crashed to starting 
←[36m2014-12-29T16:24:23.672321+00:00 heroku[web.1]:←[0m Starting process with command `node server/app.js` 
←[36m2014-12-29T16:24:24.673230+00:00 app[web.1]:←[0m 
←[36m2014-12-29T16:24:24.675428+00:00 app[web.1]:←[0m at Function.Module._resolveFilename (module.js:338:15) 
←[36m2014-12-29T16:24:24.675431+00:00 app[web.1]:←[0m at Module.require (module.js:364:17) 
←[36m2014-12-29T16:24:24.675436+00:00 app[web.1]:←[0m at module.exports (/app/server/config/express.js:38:13) 
←[36m2014-12-29T16:24:24.673540+00:00 app[web.1]:←[0m module.js:340 
←[36m2014-12-29T16:24:24.673797+00:00 app[web.1]:←[0m throw err; 
←[36m2014-12-29T16:24:24.673804+00:00 app[web.1]:←[0m   ^
←[36m2014-12-29T16:24:24.675438+00:00 app[web.1]:←[0m at Object.<anonymous> (/app/server/app.js:15:28) 
←[36m2014-12-29T16:24:24.675424+00:00 app[web.1]:←[0m Error: Cannot find module 'connect-livereload' 
←[36m2014-12-29T16:24:24.675429+00:00 app[web.1]:←[0m at Function.Module._load (module.js:280:25) 
←[36m2014-12-29T16:24:24.675443+00:00 app[web.1]:←[0m at Object.Module._extensions..js (module.js:474:10) 
←[36m2014-12-29T16:24:24.675445+00:00 app[web.1]:←[0m at Module.load (module.js:356:32) 
←[36m2014-12-29T16:24:24.675434+00:00 app[web.1]:←[0m at require (module.js:380:17) 
←[36m2014-12-29T16:24:24.675441+00:00 app[web.1]:←[0m at Module._compile (module.js:456:26) 
←[36m2014-12-29T16:24:24.675447+00:00 app[web.1]:←[0m at Function.Module._load (module.js:312:12) 
←[36m2014-12-29T16:24:25.500954+00:00 heroku[web.1]:←[0m Process exited with status 8 
←[36m2014-12-29T16:24:25.515899+00:00 heroku[web.1]:←[0m State changed from starting to crashed 
←[32m2014-12-29T16:24:26.941578+00:00 heroku[router]:←[0m at=error code=H10 desc="App crashed" method=GET path="/" host=still-anchorage-3610.herokuapp.com request_id=b2c83aaa-778d-4334-8168-df88891294dd fwd="64.255.74.231" dyno= connect= service= status=503 bytes= 
←[32m2014-12-29T16:24:27.226106+00:00 heroku[router]:←[0m at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=still-anchorage-3610.herokuapp.com request_id=4ffb26a0-d806-436b-8bf1-703cc39e17b7 fwd="64.255.74.231" dyno= connect= service= status=503 bytes= 
+0

package.json을 올바르게 배치 했습니까? 이것이 앱 선언문이므로 앱을 배포하려면 애플리케이션에 필요한 모든 종속성으로 업데이트해야합니다. – facundofarias

+0

'package.json'이 올바르지 않다면 로컬에서 작동하지 않을 것입니다. 맞습니까? – Austin

+0

에 따라 다릅니다. npm install을 실행하여 종속성을 자체적으로 설치했지만 --save 옵션을 지정하지 않은 경우에는 매니페스트에 로컬로 설치되는 것과 다른 것을 설치해야합니다. – facundofarias

답변

0

합니다. 로컬 개발 환경에서만 사용해야합니다. 당신은 프로덕션 환경이로드되지 않도록 할 필요가 당신의 app.js 라인 (15)의 주위에

app.use(require('connect-livereload')()); 

: 당신은 아마 코드 같은 것을 가지고있다. 당신은 같은 if 문 뭔가이 줄을 바꿈 수 :

if (process.env.NODE_ENV === 'development') { 
    app.use(require('connect-livereload')()); 
} 

이것은 당신이 당신이 응용 프로그램을 실행하는 환경에 따라 개발, 테스트 또는 생산으로 설정 NODE_ENV라는 환경 변수를 가지고 있다고 가정합니다.

+0

그래서 내가 원래 코드를 수정했거나 처음'if'에 추가해야합니까? '(개발 === env || '테스트'=== 환경) if ('개발'=== env || process.env.NODE_ENV === '개발') { app.use (require ('connect-livereload')()); } app.use (경로. 조인 (config.root, '.tmp'))); app.use (express.static (path.join (config.root, 'client')))); app.set ('appPath', 'client'); app.use (morgan ('dev')); app.use (errorHandler()); // 오류 처리기 - 마지막으로 이어야합니다. ' – Austin

+0

또한, 내 package.json에서 "종속성"대신 "종속성"이었기 때문에 "종속성"으로 변경했으며 설치 패키지가 많은 것처럼 보입니다 물건이지만, 나는 또한 오류가 있다고 생각합니다. 너무 많이 인쇄되어 더 이상 명령 줄 맨이 보이지 않습니다. 그것은 "의존성"이 될 필요가 있으며 뱉어 내고있는 모든 정보를 출력하는 방법이 있습니까? – Austin

+0

Heruko를 사용하기 전에 응용 프로그램을로드하는 데 'grunt serve'명령을 사용했는데 특별한 의미가 있습니까? – Austin

관련 문제