节点Heroku部署找不到导出的Mongo架构

从我的节点应用程序的Heroku生成过程完成没有问题,但是当我尝试访问部署的网站Heroku日志显示以下错误:

2017-09-19T18:50:49.490021+00:00 app[web.1]: > simple-weather-app@0.0.0 start /app 2017-09-19T18:50:49.490022+00:00 app[web.1]: > node server.js 2017-09-19T18:50:50.665027+00:00 app[web.1]: module.js:487 2017-09-19T18:50:50.665042+00:00 app[web.1]: throw err; 2017-09-19T18:50:50.665043+00:00 app[web.1]: ^ 2017-09-19T18:50:50.665045+00:00 app[web.1]: Error: Cannot find module '../models/location' 2017-09-19T18:50:50.665046+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:485:15) 2017-09-19T18:50:50.665047+00:00 app[web.1]: at Module.require (module.js:513:17) 2017-09-19T18:50:50.665044+00:00 app[web.1]: 2017-09-19T18:50:50.665046+00:00 app[web.1]: at Function.Module._load (module.js:437:25) 2017-09-19T18:50:50.665048+00:00 app[web.1]: at require (internal/module.js:11:18) 2017-09-19T18:50:50.665049+00:00 app[web.1]: at Module._compile (module.js:569:30) 2017-09-19T18:50:50.665048+00:00 app[web.1]: at Object.<anonymous> (/app/routes/index.js:4:16) 2017-09-19T18:50:50.665050+00:00 app[web.1]: at Object.Module._extensions..js (module.js:580:10) 

回购可在这里: https : //github.com/lgants/simple-weather-app 。 而且,它可以在当地find。 有什么想法造成这个?

在您发送的资料库中,文件大写为Location.js但是您正在调用文件../models/location 。 确保调用文件名称,大写的字符取决于操作系统的差异,这就是为什么它在本地工作,而不是在Heroku。

将其更改为../models/Location.js