2

アプリをデプロイして、このチュートリアルのコードをプッシュするとすぐに: http://blog.superpat.com/2011/06/14/node-js-chat-demo-on-heroku/

heroku から次のエラーを受け取りました:「アプリケーションでエラーが発生したため、ページを表示できませんでした。しばらくしてからもう一度お試しください。

あなたがアプリケーションの所有者である場合は、詳細についてログを確認してください。」

これが私が得ているログエラーです:

2013-05-07T12:46:21.537628+00:00 app[web.1]: module.js:340
2013-05-07T12:46:21.537946+00:00 app[web.1]:     throw err;
2013-05-07T12:46:21.538118+00:00 app[web.1]:           ^
2013-05-07T12:46:21.540143+00:00 app[web.1]: Error: Cannot find module 'pg'
2013-05-07T12:46:21.540143+00:00 app[web.1]:     at Function.Module._resolveFilename (module.js:338:15)
2013-05-07T12:46:21.540143+00:00 app[web.1]:     at Function.Module._load (module.js:280:25)
2013-05-07T12:46:21.540143+00:00 app[web.1]:     at require (module.js:380:17)
2013-05-07T12:46:21.540143+00:00 app[web.1]:     at Object.<anonymous> (/app/server.js:22:10)
2013-05-07T12:46:21.540143+00:00 app[web.1]:     at Module._compile (module.js:456:26)
2013-05-07T12:46:21.540143+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:474:10)
2013-05-07T12:46:21.540143+00:00 app[web.1]:     at Module.load (module.js:356:32)
2013-05-07T12:46:21.540143+00:00 app[web.1]:     at Module.require (module.js:364:17)
2013-05-07T12:46:21.540462+00:00 app[web.1]:     at Function.Module.runMain (module.js:497:10)
2013-05-07T12:46:21.540143+00:00 app[web.1]:     at Function.Module._load (module.js:312:12)
2013-05-07T12:46:22.755998+00:00 heroku[web.1]: Process exited with status 8
2013-05-07T12:47:21.212523+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=nodechatclient.herokuapp.com fwd="72.229.150.213" dyno= connect= service= status=503 bytes=
2013-05-07T12:47:22.593111+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=nodechatclient.herokuapp.com fwd="72.229.150.213" dyno= connect= service= status=503 bytes=

そのチュートリアルの github のすべてのコードに従いました。

何が原因でしょうか?pgと何か関係がありますか?データベースのパスをどこかで変更する必要がありましたか?

node server.js を使用してローカルで実行しようとすると、次のエラーが発生します。

Error: Cannot find module    '/home/euridice/node_modules/pg/lib/native/../../build/default/binding'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/euridice/node_modules/pg/lib/native/index.js:16:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

どういう意味ですか?

編集:いくつかのことを修正し、今私は得ています:

events.js:72
    throw er; // Unhandled 'error' event
          ^
Error: FATAL:  password authentication failed for user "postgres"
FATAL:  password authentication failed for user "postgres"

at Connection.<anonymous>    (/home/euridice/node_chat/node_modules/pg/lib/native/index.js:187:17)
at Connection.EventEmitter.emit (events.js:95:17)
4

1 に答える 1

3

走る

npm install

また、「node_modules」フォルダーを heroku にプッシュします

編集: git と herkoku の概念を誤解していると思います。必要がある:

1. clone the repository: 'git clone git://github.com/metadaddy-sfdc/node_chat.git'
2. go into the repository: 'cd node_chat'
3. now you can run 'npm install' in THAT folder
4. after that you can create your heroku app: 'heroku create'
5. and deploy that to heroku: 
  5.1 git add .
  5.2 git commit -m "some comment"
  5.3 git push heroku master

a) node_chat フォルダーにいる必要があります。b) 最初に npm をインストールしてから、すべて (git add .) を heroku にプッシュします。

于 2013-05-07T14:58:46.790 に答える