node.jsでsocket.ioを用いたアプリをherokuでアプリを公開しようとしたところアプリケーションエラーが出たためご教授願いたいです
・バージョン
os windows8
node.js Windows (x64)12.14.1 LTS
socket.io@2.3.0
初心者のためサイトを見ながらgithubと連携させて試行錯誤しながらデプロイが完了するところまで行ったのですが、コマンドプロンプトにて
heroku logs --tail
で実行させたところ以下のエラーが表示されました
2020-02-06T09:12:41.853601+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2020-02-06T09:12:41.853603+00:00 app[web.1]: requireStack: [ '/app/server.js' ]
2020-02-06T09:12:41.853605+00:00 app[web.1]: }
2020-02-06T09:12:41.860427+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-02-06T09:12:41.860752+00:00 app[web.1]: npm ERR! errno 1
2020-02-06T09:12:41.862499+00:00 app[web.1]: npm ERR! soket.io-src@1.0.0 start:
node server.js
2020-02-06T09:12:41.862722+00:00 app[web.1]: npm ERR! Exit status 1
2020-02-06T09:12:41.863130+00:00 app[web.1]: npm ERR!
2020-02-06T09:12:41.863314+00:00 app[web.1]: npm ERR! Failed at the soket.io-src
@1.0.0 start script.
2020-02-06T09:12:41.863632+00:00 app[web.1]: npm ERR! This is probably not a pro
blem with npm. There is likely additional logging output above.
2020-02-06T09:12:41.871472+00:00 app[web.1]: npm WARN Local package.json exists,
but node_modules missing, did you mean to install?
2020-02-06T09:12:41.872430+00:00 app[web.1]:
2020-02-06T09:12:41.872716+00:00 app[web.1]: npm ERR! A complete log of this run
can be found in:
2020-02-06T09:12:41.872913+00:00 app[web.1]: npm ERR! /app/.npm/logs/2020-0
2-06T09_12_41_864Z-debug.log
2020-02-06T09:12:41.945431+00:00 heroku[web.1]: Process exited with status 1
2020-02-06T09:12:43.088119+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/favicon.ico" host=chat-app-kazuki.herokuapp.com request
id=12b00705-d6ec-4f13-88fd-0093b9f98710 fwd="60.76.188.13" dyno= connect= servic
e= status=503 bytes= protocol=https
2020-02-06T09:17:12.874306+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=chat-app-kazuki.herokuapp.com request_id=06129f93
-2419-4bc2-b449-9f99c65ce85f fwd="60.76.188.13" dyno= connect= service= status=5
03 bytes= protocol=https
2020-02-06T09:17:13.277081+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/favicon.ico" host=chat-app-kazuki.herokuapp.com request_
id=24db0885-d6d5-4373-8074-2cdf3d9e11b6 fwd="60.76.188.13" dyno= connect= servic
e= status=503 bytes= protocol=https
2020-02-06T09:18:25.769774+00:00 heroku[web.1]: State changed from crashed to st
arting
2020-02-06T09:18:28.181974+00:00 heroku[web.1]: Starting process with command n pm start
2020-02-06T09:18:30.488243+00:00 heroku[web.1]: State changed from starting to c
rashed
2020-02-06T09:18:30.283668+00:00 app[web.1]:
2020-02-06T09:18:30.283706+00:00 app[web.1]: > soket.io-src@1.0.0 start /app
2020-02-06T09:18:30.283709+00:00 app[web.1]: > node server.js
2020-02-06T09:18:30.283711+00:00 app[web.1]:
2020-02-06T09:18:30.382071+00:00 app[web.1]: internal/modules/cjs/loader.js:796
2020-02-06T09:18:30.382074+00:00 app[web.1]: throw err;
2020-02-06T09:18:30.382076+00:00 app[web.1]: ^
2020-02-06T09:18:30.382078+00:00 app[web.1]:
2020-02-06T09:18:30.382080+00:00 app[web.1]: Error: Cannot find module 'socket.i
o'
2020-02-06T09:18:30.382083+00:00 app[web.1]: Require stack:
2020-02-06T09:18:30.382085+00:00 app[web.1]: - /app/server.js
2020-02-06T09:18:30.382093+00:00 app[web.1]: at Function.Module._resolveFilename
(internal/modules/cjs/loader.js:793:17)
2020-02-06T09:18:30.382095+00:00 app[web.1]: at Function.Module._load (internal/
modules/cjs/loader.js:686:27)
2020-02-06T09:18:30.382102+00:00 app[web.1]: at Module.require (internal/modules
/cjs/loader.js:848:19)
2020-02-06T09:18:30.382105+00:00 app[web.1]: at require (internal/modules/cjs/he
lpers.js:74:18)
2020-02-06T09:18:30.382106+00:00 app[web.1]: at Object.<anonymous> (/app/server.
js:14:10)
2020-02-06T09:18:30.382108+00:00 app[web.1]: at Module._compile (internal/module
s/cjs/loader.js:955:30)
2020-02-06T09:18:30.382110+00:00 app[web.1]: at Object.Module._extensions..js (i
nternal/modules/cjs/loader.js:991:10)
2020-02-06T09:18:30.382112+00:00 app[web.1]: at Module.load (internal/modules/cj
s/loader.js:811:32)
2020-02-06T09:18:30.382114+00:00 app[web.1]: at Function.Module._load (internal/
modules/cjs/loader.js:723:14)
2020-02-06T09:18:30.382116+00:00 app[web.1]: at Function.Module.runMain (interna
l/modules/cjs/loader.js:1043:10) {
2020-02-06T09:18:30.382118+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2020-02-06T09:18:30.382120+00:00 app[web.1]: requireStack: [ '/app/server.js' ]
2020-02-06T09:18:30.382122+00:00 app[web.1]: }
2020-02-06T09:18:30.394856+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-02-06T09:18:30.395238+00:00 app[web.1]: npm ERR! errno 1
2020-02-06T09:18:30.396796+00:00 app[web.1]: npm ERR! soket.io-src@1.0.0 start:
node server.js
2020-02-06T09:18:30.396979+00:00 app[web.1]: npm ERR! Exit status 1
2020-02-06T09:18:30.397209+00:00 app[web.1]: npm ERR!
2020-02-06T09:18:30.397316+00:00 app[web.1]: npm ERR! Failed at the soket.io-src
@1.0.0 start script.
2020-02-06T09:18:30.397473+00:00 app[web.1]: npm ERR! This is probably not a pro
blem with npm. There is likely additional logging output above.
2020-02-06T09:18:30.406970+00:00 app[web.1]: npm WARN Local package.json exists,
but node_modules missing, did you mean to install?
2020-02-06T09:18:30.407591+00:00 app[web.1]:
2020-02-06T09:18:30.407793+00:00 app[web.1]: npm ERR! A complete log of this run
can be found in:
2020-02-06T09:18:30.407900+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-0
2-06T09_18_30_398Z-debug.log
2020-02-06T09:18:30.473193+00:00 heroku[web.1]: Process exited with status 1
2020-02-06T09:19:29.000000+00:00 app[api]: Build started by user naru-93light@i.
softbank.jp
2020-02-06T09:19:42.670029+00:00 app[api]: Deploy 43f923a3 by user naru-93light@
i.softbank.jp
2020-02-06T09:19:42.670029+00:00 app[api]: Release v7 created by user naru-93lig
ht@i.softbank.jp
2020-02-06T09:19:43.925575+00:00 heroku[web.1]: State changed from crashed to st
arting
2020-02-06T09:19:42.000000+00:00 app[api]: Build succeeded
2020-02-06T09:19:45.520043+00:00 heroku[web.1]: Starting process with command n pm start
2020-02-06T09:19:47.257730+00:00 heroku[web.1]: State changed from starting to c
rashed
2020-02-06T09:19:47.130495+00:00 app[web.1]:
2020-02-06T09:19:47.130511+00:00 app[web.1]: > soket.io-src@1.0.0 start /app
2020-02-06T09:19:47.130513+00:00 app[web.1]: > node server.js
2020-02-06T09:19:47.130515+00:00 app[web.1]:
2020-02-06T09:19:47.184217+00:00 app[web.1]: internal/modules/cjs/loader.js:796
2020-02-06T09:19:47.184220+00:00 app[web.1]: throw err;
2020-02-06T09:19:47.184222+00:00 app[web.1]: ^
2020-02-06T09:19:47.184224+00:00 app[web.1]:
2020-02-06T09:19:47.184226+00:00 app[web.1]: Error: Cannot find module 'socket.i
o'
2020-02-06T09:19:47.184228+00:00 app[web.1]: Require stack:
2020-02-06T09:19:47.184231+00:00 app[web.1]: - /app/server.js
2020-02-06T09:19:47.184233+00:00 app[web.1]: at Function.Module._resolveFilename
(internal/modules/cjs/loader.js:793:17)
2020-02-06T09:19:47.184235+00:00 app[web.1]: at Function.Module._load (internal/
modules/cjs/loader.js:686:27)
2020-02-06T09:19:47.184239+00:00 app[web.1]: at Module.require (internal/modules
/cjs/loader.js:848:19)
2020-02-06T09:19:47.184241+00:00 app[web.1]: at require (internal/modules/cjs/he
lpers.js:74:18)
2020-02-06T09:19:47.184244+00:00 app[web.1]: at Object.<anonymous> (/app/server.
js:14:10)
2020-02-06T09:19:47.184246+00:00 app[web.1]: at Module._compile (internal/module
s/cjs/loader.js:955:30)
2020-02-06T09:19:47.184248+00:00 app[web.1]: at Object.Module._extensions..js (i
nternal/modules/cjs/loader.js:991:10)
2020-02-06T09:19:47.184250+00:00 app[web.1]: at Module.load (internal/modules/cj
s/loader.js:811:32)
2020-02-06T09:19:47.184252+00:00 app[web.1]: at Function.Module._load (internal/
modules/cjs/loader.js:723:14)
2020-02-06T09:19:47.184254+00:00 app[web.1]: at Function.Module.runMain (interna
l/modules/cjs/loader.js:1043:10) {
ローカルで開発したときには何もエラーが表示されてません。
サイトを参考にしたところH10エラーはクラッシュしたため再起動させると書いてあったので試したところなにもかわらずでした
あなたの回答
tips
プレビュー