在heroku上部署/托管节点应用程序时遇到问题?

时间:2019-07-15 17:19:58

标签: node.js express heroku mongoose deployment

我正在尝试在Heroku上部署我的node js应用程序,该应用程序已成功部署,但是当我尝试打开该应用程序时,它显示了应用程序错误。

该应用程序可以在本地主机上正常运行。还设置了环境变量,并且正确导出了所有的猫鼬模型。

日志为:

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

1 个答案:

答案 0 :(得分:0)

请尝试确保所有模块都包括在内。如果您有一个名为designs = Designs.AsEnumerable() .Where(row => values.Contains(row.Field<Guid>("DesignGroupId")) && row.Field<int>("DesignKey") == null).CopyToDataTable(); 的未提交文件,则很可能是罪魁祸首。