2016-06-23 14 views
0

こんにちは皆、私のノードアプリケーションをHerokuに配備するのは簡単だろうと思っていました。 24のビルドを展開した後、私は何が間違っているのか分かりません。 localhost:[port]を使用してアプリケーションを実行すると正常に動作していますが、Herokuでは素晴らしいとは限りません。Node.jsを使用したHerokuアプリケーションのデプロイエラーコードH10

私は私が私のノードパッケージが再作成されていることがわかり、私はコマンドgit push heroku masterを使用していたときにことに注意してください(?):

Building dependencies 
remote:  Prebuild detected (node_modules already exists) 
remote:  Rebuilding any native modules 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/express 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/accepts 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/mime-types 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/mime-db 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/negotiator 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/array-flatten 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/content-disposition 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/content-type 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/cookie 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/cookie-signature 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/debug 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/ms 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/depd 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/encodeurl 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/escape-html 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/etag 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/finalhandler 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/on-finished 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/ee-first 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/statuses 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/unpipe 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/fresh 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/merge-descriptors 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/methods 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/parseurl 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/path-to-regexp 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/proxy-addr 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/forwarded 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/ipaddr.js 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/qs 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/range-parser 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/express/node_modules/send 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/destroy 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/http-errors 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/inherits 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/setprototypeof 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/mime 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/serve-static 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/send 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/type-is 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/media-typer 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/utils-merge 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/vary 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/jade 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/character-parser 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/clean-css 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/clean-css/node_modules/commander 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/graceful-readlink 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/source-map 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/amdefine 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/commander 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/constantinople 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/acorn 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/jstransformer 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/is-promise 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/promise 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/asap 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/mkdirp 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/minimist 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/transformers 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/css 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/css-parse 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/css-stringify 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/transformers/node_modules/promise 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/transformers/node_modules/is-promise 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/transformers/node_modules/uglify-js 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/optimist 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/wordwrap 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/transformers/node_modules/source-map 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/uglify-js 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/async 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/uglify-js/node_modules/source-map 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/uglify-to-browserify 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/yargs 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/camelcase 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/cliui 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/center-align 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/align-text 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/kind-of 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/is-buffer 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/longest 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/repeat-string 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/lazy-cache 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/right-align 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/cliui/node_modules/wordwrap 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/decamelize 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/window-size 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/void-elements 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/with 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/with/node_modules/acorn 
remote:  [email protected] /tmp/build_a769e7fce1f5ff3a3dbd69d44125be90/node_modules/acorn-globals 
remote:  Installing any new modules (package.json) 
remote: 

から、私はテキストのその巨大な壁をお詫び申し上げますしかし、あなたが見ているもの私が理解していることは、私のnode_modulesフォルダ内のすべてのノードモジュールが何らかの理由で再作成されているということです。しかし、これが起こった後、ビルドは成功し、使用する準備ができています。

したがって、コマンドheroku ps:scale web=1を実行すると、メッセージScaling dynos... done, now running web at 1:Freeが表示されます。これまでのところとても良いですが、アプリケーションを実際に開いたときにアプリケーションエラーが発生するので、私はheroku logs -n 52と入力しました。しかし、ここで私に戻って与えられているものである。

2016-06-23T23:02:31.826487+00:00 heroku[web.1]: State changed from starting to crashed 
2016-06-23T23:04:08.293203+00:00 heroku[api]: Release v24 created by [email protected] 
2016-06-23T23:04:08.293113+00:00 heroku[api]: Deploy a4025b7 by [email protected] 
2016-06-23T23:04:08.501758+00:00 heroku[slug-compiler]: Slug compilation started 
2016-06-23T23:04:08.501767+00:00 heroku[slug-compiler]: Slug compilation finished 
2016-06-23T23:04:08.465484+00:00 heroku[web.1]: State changed from crashed to starting 
2016-06-23T23:04:12.635495+00:00 heroku[web.1]: Starting process with command `npm start` 
2016-06-23T23:04:15.429410+00:00 app[web.1]: 
2016-06-23T23:04:15.429425+00:00 app[web.1]: > [email protected] start /app 
2016-06-23T23:04:15.429431+00:00 app[web.1]: > node src/app.js 
2016-06-23T23:04:15.429432+00:00 app[web.1]: 
2016-06-23T23:04:15.639033+00:00 app[web.1]: module.js:327 
2016-06-23T23:04:15.639043+00:00 app[web.1]:  throw err; 
2016-06-23T23:04:15.639043+00:00 app[web.1]: ^
2016-06-23T23:04:15.639059+00:00 app[web.1]: Error: Cannot find module './mock/test.json' 
2016-06-23T23:04:15.639057+00:00 app[web.1]: 
2016-06-23T23:04:15.639060+00:00 app[web.1]:  at Function.Module._load (module.js:276:25) 
2016-06-23T23:04:15.639061+00:00 app[web.1]:  at Module.require (module.js:353:17) 
2016-06-23T23:04:15.639060+00:00 app[web.1]:  at Function.Module._resolveFilename (module.js:325:15) 
2016-06-23T23:04:15.639062+00:00 app[web.1]:  at require (internal/module.js:12:17) 
2016-06-23T23:04:15.639062+00:00 app[web.1]:  at Object.<anonymous> (/app/src/app.js:4:19) 
2016-06-23T23:04:15.639063+00:00 app[web.1]:  at Module._compile (module.js:409:26) 
2016-06-23T23:04:15.639065+00:00 app[web.1]:  at Function.Module._load (module.js:300:12) 
2016-06-23T23:04:15.639063+00:00 app[web.1]:  at Object.Module._extensions..js (module.js:416:10) 
2016-06-23T23:04:15.639064+00:00 app[web.1]:  at Module.load (module.js:343:32) 
2016-06-23T23:04:15.654257+00:00 app[web.1]: npm ERR! node v4.4.5 
2016-06-23T23:04:15.653958+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start" 
2016-06-23T23:04:15.653512+00:00 app[web.1]: npm ERR! Linux 3.13.0-85-generic 
2016-06-23T23:04:15.639065+00:00 app[web.1]:  at Function.Module.runMain (module.js:441:10) 
2016-06-23T23:04:15.646563+00:00 app[web.1]: 
2016-06-23T23:04:15.655142+00:00 app[web.1]: npm ERR! npm v2.15.5 
2016-06-23T23:04:15.656197+00:00 app[web.1]: npm ERR! This is most likely a problem with the abcusd package, 
2016-06-23T23:04:15.655683+00:00 app[web.1]: npm ERR! Exit status 1 
2016-06-23T23:04:15.656034+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script 'node src/app.js'. 
2016-06-23T23:04:15.655527+00:00 app[web.1]: npm ERR! [email protected] start: `node src/app.js` 
2016-06-23T23:04:15.655890+00:00 app[web.1]: npm ERR! 
2016-06-23T23:04:15.656507+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system: 
2016-06-23T23:04:15.656352+00:00 app[web.1]: npm ERR! not with npm itself. 
2016-06-23T23:04:15.656663+00:00 app[web.1]: npm ERR!  node src/app.js 
2016-06-23T23:04:15.656813+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with: 
2016-06-23T23:04:15.657050+00:00 app[web.1]: npm ERR!  npm bugs abcusd 
2016-06-23T23:04:15.655368+00:00 app[web.1]: npm ERR! code ELIFECYCLE 
2016-06-23T23:04:15.657292+00:00 app[web.1]: npm ERR! 
2016-06-23T23:04:15.657124+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via: 
2016-06-23T23:04:15.657430+00:00 app[web.1]: npm ERR!  npm owner ls abcusd 
2016-06-23T23:04:15.657611+00:00 app[web.1]: npm ERR! There is likely additional logging output above. 
2016-06-23T23:04:15.660924+00:00 app[web.1]: 
2016-06-23T23:04:15.661300+00:00 app[web.1]: npm ERR!  /app/npm-debug.log 
2016-06-23T23:04:15.661148+00:00 app[web.1]: npm ERR! Please include the following file with any support request: 
2016-06-23T23:04:16.484660+00:00 heroku[web.1]: State changed from starting to crashed 
2016-06-23T23:04:16.476664+00:00 heroku[web.1]: Process exited with status 1 
2016-06-23T23:04:24.383512+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=abcusd.herokuapp.com request_id=c782e08e-5862-4ae2-89ab-26d2c52aba1b fwd="99.6.116.10" dyno= connect= service= status=503 bytes= 
2016-06-23T23:04:24.784780+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=abcusd.herokuapp.com request_id=93241ada-ddfa-4356-9d1f-e6809ee8ef6c fwd="99.6.116.10" dyno= connect= service= status=503 bytes= 

最も私に興味の部分は、これがある:レンダリング時に私のページにデータを提供するJSONファイルへと私の知識ではないモジュールへの参照だけだError: Cannot find module './mock/test.json'ノードモジュールと同じ方法でモジュールと見なされます。私は、モジュールが再作成されているときに、私のjsonファイルが台無しになっていると思うが、それは実際には今のところ推測だ。私は間違って何をしていますか?

乾杯

EDIT - package.json

{ 
    "name": "abcusd", 
    "version": "1.0.0", 
    "description": "special education website", 
    "main": "ABCUSD/", 
    "engines": { 
    "node": "^4.4.2" 
    }, 
    "scripts": { 
    "start": "node src/app.js" 
    }, 
    "repository": { 
    "type": "git", 
    "url": "git+https://github.com/m00se333/ABCUSD.git" 
    }, 
    "author": "Maurice Cunningham", 
    "license": "MIT", 
    "bugs": { 
    "url": "https://github.com/m00se333/ABCUSD/issues" 
    }, 
    "homepage": "https://github.com/m00se333/ABCUSD#readme", 
    "dependencies": { 
    "express": "^4.14.0", 
    "jade": "^1.11.0" 
    } 
} 

enter image description here

+0

mock/test.jsonがherokuに到達し、gitで無視されていないことを確認できますか?また、ファイルには何が含まれていますか?必要なすべてのモジュールが依存関係としてpackage.jsonにあることを再度確認してください。 – theatlasroom

+0

''/ mock/test.json''を''/mock/test.json''としてドットなしで記述してください。 –

+0

@theatlasroom応答してくれてありがとう、私はすべての私のファイルがgitによって追跡されていることを確認した、何も亀裂を滑っていない。 '。/ mock/test.json'ファイルへのパスはノードモジュールではありません。 @EshwarPrasadYaddanapudi私はそれをもう一度試してみるつもりですが、私はそれを試していて、あなたの提案を試しました。/ mock/test.json'と私はうまくいきません。しかし、お返事ありがとうございます。 – m00saca

答えて

0

を含むソースファイルのいずれかが./mock/test.json要求しているように見えますが、それはgitのではありませんし、そうですherokuにアップロードされていません。

このインスタンスのモジュールは、ノードのModule.jsであり、必要な呼び出しを処理します。これに失敗したパスにnode_modulesとは関係がないことを指定してください。

+0

こんにちは@bknights私はちょうど私のgithubのレポとすべての私のファイルをチェックしたしかし、私は 'package.json'ファイルに何か問題があると思います。サーバが起動するデフォルトのパスを設定する方法がわかりません。例えば、私のファイルシステムのルートにいたいです。私は正確に他のファイルを参照することができますが、私はそれを正しく行ったとは思いません。私の 'package.json'ファイルを見たいですか? – m00saca

+0

あなたのプロジェクトはローカルで実行されますか? – bknights

+0

私の質問に私の 'package.json'を含めるように編集しました。あなたの質問に答えるために、私のプロジェクトはローカルで実行されます: ' nodemon src/app.js'または 'node src/app.js'。私のプロジェクトのルートは私のlocaの' haloApp'ですl機械。私はそれが英雄に配備されたときに何がなるのか分かりません。 – m00saca

関連する問題