nswbmw / N-club

使用 Koa + MongoDB + Redis 搭建论坛系统
515 stars 107 forks source link

关于在heroku部署的问题? #3

Open quoniammm opened 8 years ago

quoniammm commented 8 years ago

我在本地调试成功了,但是部署到heroku的时候,访问地址出现下面的情况:

Application Error
An error occurred in the application and your page could not be served. 
Please try again in a few moments.

If you are the application owner, check your logs for details.

然后查看heroku logs(没有看懂),请教一下这是哪里除了问题?

heroku logs
2015-10-24T11:52:04.305187+00:00 heroku[api]: Enable Logplex by quoniamy@gmail.com
2015-10-24T11:52:04.305187+00:00 heroku[api]: Release v2 created by quoniamy@gmail.com
2015-10-24T11:55:22.335600+00:00 heroku[slug-compiler]: Slug compilation started
2015-10-24T11:55:22.335610+00:00 heroku[slug-compiler]: Slug compilation finished
2015-10-24T11:55:22.168034+00:00 heroku[api]: Scale to web=1 by quoniamy@gmail.com
2015-10-24T11:55:22.244773+00:00 heroku[api]: Deploy e1c7aa8 by quoniamy@gmail.com
2015-10-24T11:55:22.244773+00:00 heroku[api]: Release v3 created by quoniamy@gmail.com
2015-10-24T11:55:23.126384+00:00 heroku[web.1]: Starting process with command `npm start`
2015-10-24T11:55:24.358943+00:00 app[web.1]: 
2015-10-24T11:55:24.358950+00:00 app[web.1]: > V-club@0.0.1 start /app
2015-10-24T11:55:24.358951+00:00 app[web.1]: > NODE_ENV=default DEBUG=* node --harmony app
2015-10-24T11:55:24.358952+00:00 app[web.1]: 
2015-10-24T11:55:24.905440+00:00 app[web.1]: module.js:338
2015-10-24T11:55:24.921552+00:00 app[web.1]: npm ERR! Linux 3.13.0-66-generic
2015-10-24T11:55:24.921935+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2015-10-24T11:55:24.922128+00:00 app[web.1]: npm ERR! node v0.12.2
2015-10-24T11:55:24.922485+00:00 app[web.1]: npm ERR! npm  v2.7.4
2015-10-24T11:55:24.922642+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2015-10-24T11:55:24.922900+00:00 app[web.1]: npm ERR! Exit status 1
2015-10-24T11:55:24.922789+00:00 app[web.1]: npm ERR! V-club@0.0.1 start: `NODE_ENV=default DEBUG=* node --harmony app`
2015-10-24T11:55:24.923062+00:00 app[web.1]: npm ERR! 
2015-10-24T11:55:24.923132+00:00 app[web.1]: npm ERR! Failed at the V-club@0.0.1 start script 'NODE_ENV=default DEBUG=* node --harmony app'.
2015-10-24T11:55:24.923263+00:00 app[web.1]: npm ERR! This is most likely a problem with the V-club package,
2015-10-24T11:55:24.923372+00:00 app[web.1]: npm ERR! not with npm itself.
2015-10-24T11:55:24.905470+00:00 app[web.1]:     throw err;
2015-10-24T11:55:24.905471+00:00 app[web.1]:     ^
2015-10-24T11:55:24.923465+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2015-10-24T11:55:24.923668+00:00 app[web.1]: npm ERR! You can get their info via:
2015-10-24T11:55:24.923570+00:00 app[web.1]: npm ERR!     NODE_ENV=default DEBUG=* node --harmony app
2015-10-24T11:55:24.923773+00:00 app[web.1]: npm ERR!     npm owner ls V-club
2015-10-24T11:55:24.923882+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2015-10-24T11:55:24.926338+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2015-10-24T11:55:24.905474+00:00 app[web.1]:     at Function.Module._load (module.js:278:25)
2015-10-24T11:55:24.926238+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2015-10-24T11:55:24.925971+00:00 app[web.1]: 
2015-10-24T11:55:24.905473+00:00 app[web.1]:     at Function.Module._resolveFilename (module.js:336:15)
2015-10-24T11:55:24.905474+00:00 app[web.1]:     at Module.require (module.js:365:17)
2015-10-24T11:55:24.905476+00:00 app[web.1]:     at Module._compile (module.js:460:26)
2015-10-24T11:55:24.905472+00:00 app[web.1]: Error: Cannot find module 'gravatar'
2015-10-24T11:55:24.905475+00:00 app[web.1]:     at require (module.js:384:17)
2015-10-24T11:55:24.905477+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:478:10)
2015-10-24T11:55:24.905476+00:00 app[web.1]:     at Object.<anonymous> (/app/theme/helpers/filters.js:1:78)
2015-10-24T11:55:24.905478+00:00 app[web.1]:     at Module.load (module.js:355:32)
2015-10-24T11:55:24.905478+00:00 app[web.1]:     at Function.Module._load (module.js:310:12)
2015-10-24T11:55:24.905479+00:00 app[web.1]:     at Module.require (module.js:365:17)
2015-10-24T11:55:24.917845+00:00 app[web.1]: 
2015-10-24T11:55:24.905480+00:00 app[web.1]:     at require (module.js:384:17)
2015-10-24T11:55:25.553391+00:00 heroku[web.1]: Process exited with status 1
2015-10-24T11:55:25.555369+00:00 heroku[web.1]: State changed from crashed to starting
2015-10-24T11:55:25.554197+00:00 heroku[web.1]: State changed from starting to crashed
2015-10-24T11:55:26.625822+00:00 heroku[web.1]: Starting process with command `npm start`
2015-10-24T11:55:28.830544+00:00 app[web.1]: 
2015-10-24T11:55:28.830562+00:00 app[web.1]: > V-club@0.0.1 start /app
2015-10-24T11:55:28.830564+00:00 app[web.1]: > NODE_ENV=default DEBUG=* node --harmony app
2015-10-24T11:55:28.830565+00:00 app[web.1]: 
2015-10-24T11:55:29.522872+00:00 app[web.1]: npm ERR! Linux 3.13.0-66-generic
2015-10-24T11:55:29.523269+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2015-10-24T11:55:29.523470+00:00 app[web.1]: npm ERR! node v0.12.2
2015-10-24T11:55:29.523847+00:00 app[web.1]: npm ERR! npm  v2.7.4
2015-10-24T11:55:29.524185+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2015-10-24T11:55:29.524485+00:00 app[web.1]: npm ERR! V-club@0.0.1 start: `NODE_ENV=default DEBUG=* node --harmony app`
2015-10-24T11:55:29.524606+00:00 app[web.1]: npm ERR! Exit status 1
2015-10-24T11:55:29.524800+00:00 app[web.1]: npm ERR! 
2015-10-24T11:55:29.524927+00:00 app[web.1]: npm ERR! Failed at the V-club@0.0.1 start script 'NODE_ENV=default DEBUG=* node --harmony app'.
2015-10-24T11:55:29.525065+00:00 app[web.1]: npm ERR! This is most likely a problem with the V-club package,
2015-10-24T11:55:29.525181+00:00 app[web.1]: npm ERR! not with npm itself.
2015-10-24T11:55:29.525408+00:00 app[web.1]: npm ERR!     NODE_ENV=default DEBUG=* node --harmony app
2015-10-24T11:55:29.525296+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2015-10-24T11:55:29.525546+00:00 app[web.1]: npm ERR! You can get their info via:
2015-10-24T11:55:29.525657+00:00 app[web.1]: npm ERR!     npm owner ls V-club
2015-10-24T11:55:29.525786+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2015-10-24T11:55:29.527852+00:00 app[web.1]: 
2015-10-24T11:55:29.528170+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2015-10-24T11:55:29.528344+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2015-10-24T11:55:29.509126+00:00 app[web.1]: module.js:338
2015-10-24T11:55:29.509129+00:00 app[web.1]:     ^
2015-10-24T11:55:29.509128+00:00 app[web.1]:     throw err;
2015-10-24T11:55:29.509130+00:00 app[web.1]: Error: Cannot find module 'gravatar'
2015-10-24T11:55:29.509131+00:00 app[web.1]:     at Function.Module._resolveFilename (module.js:336:15)
2015-10-24T11:55:29.509131+00:00 app[web.1]:     at Function.Module._load (module.js:278:25)
2015-10-24T11:55:29.509132+00:00 app[web.1]:     at Module.require (module.js:365:17)
2015-10-24T11:55:29.509132+00:00 app[web.1]:     at require (module.js:384:17)
2015-10-24T11:55:29.509133+00:00 app[web.1]:     at Object.<anonymous> (/app/theme/helpers/filters.js:1:78)
2015-10-24T11:55:29.509133+00:00 app[web.1]:     at Module._compile (module.js:460:26)
2015-10-24T11:55:29.509134+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:478:10)
2015-10-24T11:55:29.509134+00:00 app[web.1]:     at Module.load (module.js:355:32)
2015-10-24T11:55:29.509135+00:00 app[web.1]:     at Function.Module._load (module.js:310:12)
2015-10-24T11:55:29.519168+00:00 app[web.1]: 
2015-10-24T11:55:29.509135+00:00 app[web.1]:     at Module.require (module.js:365:17)
2015-10-24T11:55:29.509136+00:00 app[web.1]:     at require (module.js:384:17)
2015-10-24T11:55:30.259064+00:00 heroku[web.1]: State changed from starting to crashed
2015-10-24T11:55:30.256871+00:00 heroku[web.1]: Process exited with status 1
2015-10-24T11:55:47.462119+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=voidclub.herokuapp.com request_id=d94572b8-4a77-41a3-914a-c2136802c5dc fwd="158.199.193.222" dyno= connect= service= status=503 bytes=
2015-10-24T11:55:48.429317+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=voidclub.herokuapp.com request_id=efc8b77c-88ee-4140-bbce-43b1e4386d7b fwd="158.199.193.222" dyno= connect= service= status=503 bytes=
quoniammm commented 8 years ago
2015-10-24T11:55:29.509130+00:00 app[web.1]: Error: Cannot find module 'gravatar'

问题出在这一块,所以是因为没有在根目录package.json实现:

"preinstall" : "cd theme && npm install"
juicexiems commented 8 years ago

本地调试成功了?能不能给我一份源码 下下来的代码跑不起来

nswbmw commented 8 years ago

@juicexiems 跑步起来报啥错?贴下