【发布时间】:2019-11-24 10:27:15
【问题描述】:
我正在尝试在 Heroku 上部署我的 node js 应用程序,该应用程序已成功部署,但是当我尝试打开该应用程序时,它显示应用程序错误。
该应用程序在 localhost 上运行良好。环境变量也设置好了,所有的猫鼬模型都正确导出了。
日志是:
Starting process with
command `node app.js`
2019-07-15T17:02:20.000000+00:00 app[api]: Build succeeded
2019-07-15T17:02:21.715707+00:00 heroku[web.1]: State changed from starting to crashed
2019-07-15T17:02:21.630743+00:00 app[web.1]: internal/modules/cjs/loader.js:584
2019-07-15T17:02:21.630764+00:00 app[web.1]: throw err;
2019-07-15T17:02:21.630765+00:00 app[web.1]: ^
2019-07-15T17:02:21.630768+00:00 app[web.1]:
2019-07-15T17:02:21.630770+00:00 app[web.1]: Error: Cannot find module './debug'
2019-07-15T17:02:21.630772+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
2019-07-15T17:02:21.630774+00:00 app[web.1]: at Function.Module._load
(internal/modules/cjs/loader.js:508:25)
2019-07-15T17:02:21.630776+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:637:17)
2019-07-15T17:02:21.630778+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:22:18)
2019-07-15T17:02:21.630780+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/debug/src/node.js:14:28)
2019-07-15T17:02:21.630782+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:701:30)
2019-07-15T17:02:21.630784+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
2019-07-15T17:02:21.630786+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:600:32)
2019-07-15T17:02:21.630788+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
2019-07-15T17:02:21.630790+00:00 app[web.1]: at Function.Module._load
(internal/modules/cjs/loader.js:531:3)
2019-07-15T17:02:21.695811+00:00 heroku[web.1]: Process exited with status 1
2019-07-15T17:02:39.924365+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=theindianstore.herokuapp.com
request_id=77c645d3-26e5-4039-a85d-df7ac3807692 fwd="27.63.166.106" dyno= connect= service= status=503 bytes= protocol=https
2019-07-15T17:02:41.158705+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=theindianstore.herokuapp.com request_id=938a0f61-5a4c-43b5-b56c-b7cf8c1acbb5 fwd="27.63.166.106" dyno= connect= service= status=503 bytes= protocol=https
【问题讨论】:
标签: node.js express heroku mongoose deployment