【发布时间】:2019-07-09 03:06:37
【问题描述】:
我使用heroku部署了我的nodejs应用程序,当我尝试在浏览器上打开它时出现错误
所以我已经用我已经设置节点环境和生产的启动脚本检查了我的 package.json,我检查了模型(错误之一指向日志上的那个),我不确定它是什么
2019-07-09T02:50:24.457773+00:00 heroku[web.1]: State changed from starting to crashed
2019-07-09T02:50:24.385238+00:00 app[web.1]: internal/modules/cjs/loader.js:613
2019-07-09T02:50:24.385263+00:00 app[web.1]: throw err;
2019-07-09T02:50:24.385266+00:00 app[web.1]: ^
2019-07-09T02:50:24.385267+00:00 app[web.1]:
2019-07-09T02:50:24.385270+00:00 app[web.1]: Error: Cannot find module '../models/user'
2019-07-09T02:50:24.385272+00:00 app[web.1]: Require stack:
2019-07-09T02:50:24.385274+00:00 app[web.1]: - /app/routes/index.js
2019-07-09T02:50:24.385276+00:00 app[web.1]: - /app/app.js
2019-07-09T02:50:24.385279+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
2019-07-09T02:50:24.385281+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:526:27)
2019-07-09T02:50:24.385368+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:666:19)
2019-07-09T02:50:24.385373+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:16:16)
2019-07-09T02:50:24.385375+00:00 app[web.1]: at Object.<anonymous> (/app/routes/index.js:3:14)
2019-07-09T02:50:24.385377+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:759:30)
2019-07-09T02:50:24.385379+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
2019-07-09T02:50:24.385381+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:628:32)
2019-07-09T02:50:24.385383+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:555:12)
2019-07-09T02:50:24.385385+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:666:19)
2019-07-09T02:50:24.438626+00:00 heroku[web.1]: Process exited with status 1
链接到 github 仓库 https://github.com/ArielBailon/b--learning
【问题讨论】:
标签: node.js mongodb express heroku