Express가있는 Node.js를 로컬로 실행 중이지만 Heroku에서 실행하려고하면 충돌이 발생합니다.Heroku에서 Express 응용 프로그램이 작동하지 않는 Node.js가 로컬로 작동합니다.
내가 배포하고 Heroku가 하위 도메인으로 이동 :
- 는 HTML로드하지만, CSS는
- 나는 아무것도 부하를 새로 고침하지 않습니다 나는 일반 응용 프로그램 오류
- 상기 상대를 얻을 수 로그가 응용 프로그램이 손상된 것 같습니다.
heroku가 계속 충돌하는 이유는 무엇입니까? 최고의 추측은 내 정적 파일과 관련이 있습니다.
{
"name": "myapp",
"version": "0.0.1",
"engines": {
"node": "0.10.26",
"npm": "1.4.20"
},
"scripts": {
"start": "node app.js"
},
"dependencies": {
"express": "~4.2.0",
"body-parser": "^1.4.3",
"node-compass": "0.2.3",
"ejs": "~1.0.0",
"express-ejs-layouts": "~1.1.0",
"mailgun-js": "^0.5.1"
}
}
내가 공용 폴더 내 CSS와 JS를 가지고 app.js에서이 라인이 :
을 여기2014-07-19T02:02:00.723361+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/javascripts/main.js" host=sendmyemail.herokuapp.com request_id=3f2d4cd8-c70d-4506-9baf-af8d98983f37 fwd="99.43.254.71" dyno=web.1 connect=1 service=43 status=503 bytes=691
2014-07-19T02:02:00.708143+00:00 app[web.1]: throw er; // Unhandled 'error' event
2014-07-19T02:02:00.709158+00:00 app[web.1]: at errnoException (child_process.js:988:11)
2014-07-19T02:02:00.708150+00:00 app[web.1]: ^
2014-07-19T02:02:00.707641+00:00 app[web.1]:
2014-07-19T02:02:00.707753+00:00 app[web.1]: events.js:72
2014-07-19T02:02:00.709155+00:00 app[web.1]: Error: spawn ENOENT
2014-07-19T02:02:00.709160+00:00 app[web.1]: at Process.ChildProcess._handle.onexit (child_process.js:779:34)
2014-07-19T02:02:02.265464+00:00 heroku[web.1]: State changed from up to crashed
2014-07-19T02:02:03.554266+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sendmyemail.herokuapp.com request_id=fc319b3f-924f-4e37-bf6f-a58a4dc25770 fwd="99.43.254.71" dyno=web.1 connect=100 service= status=503 bytes=
2014-07-19T02:02:02.255985+00:00 heroku[web.1]: Process exited with status 8
내 package.json입니다 : 여기
는 로그입니다
app.use(express['static'](path.join(__dirname, 'public')));
저장소 구조를 게시 할 수 있습니까? – paradite