启动服务器时出现heroku部署错误

时间:2020-03-27 14:18:01

标签: node.js heroku

您好,我是根据一个在我的本地计算机上正常运行的教程创建的应用程序。我在内存数据库中使用sqlite(用于开发),部署时出现以下错误。请告诉我您需要什么详细信息(我无法将检测到的完整日志记录为垃圾邮件),我是node / hapi和heroku中的新手。谢谢你。

2020-03-27T13:21:21.337440 + 00:00 app [web.1]:/app/lib/models/index.js:7 2020-03-27T13:21:21.337489 + 00:00 app [web.1]:const dbSettings = Settings [Settings.env] .db; 2020-03-27T13:21:21.337490 + 00:00 app [web.1]:^ 2020-03-27T13:21:21.337498 + 00:00 app [web.1]: 2020-03-27T13:21:21.337506 + 00:00 app [web.1]:TypeError:无法读取未定义的属性'db' 2020-03-27T13:21:21.337507 + 00:00 app [web.1]:在对象上。 (/app/lib/models/index.js:7:43) 2020-03-27T13:21:21.337507 + 00:00 app [web.1]:在Module._compile(内部/模块/cjs/loader.js:1158:30) 2020-03-27T13:21:21.337514 + 00:00 app [web.1]:位于Object.Module._extensions..js(内部/模块/cjs/loader.js:1178:10) 2020-03-27T13:21:21.337515 + 00:00 app [web.1]:在Module.load(内部/模块/cjs/loader.js:1002:32) 2020-03-27T13:21:21.337516 + 00:00 app [web.1]:位于Function.Module._load(内部/模块/cjs/loader.js:901:14) 2020-03-27T13:21:21.337516 + 00:00 app [web.1]:在Module.require(内部/模块/cjs/loader.js:1044:19) 2020-03-27T13:21:21.337516 + 00:00 app [web.1]:需要时(内部/模块/cjs/helpers.js:77:18) 2020-03-27T13:21:21.337516 + 00:00 app [web.1]:在对象处。 (/app/lib/controllers/home.js:3:16) 2020-03-27T13:21:21.337517 + 00:00 app [web.1]:在Module._compile(内部/模块/cjs/loader.js:1158:30) 2020-03-27T13:21:21.337517 + 00:00 app [web.1]:位于Object.Module._extensions..js(内部/模块/cjs/loader.js:1178:10) 2020-03-27T13:21:21.337517 + 00:00 app [web.1]:在Module.load(内部/模块/cjs/loader.js:1002:32) 2020-03-27T13:21:21.337517 + 00:00 app [web.1]:位于Function.Module._load(内部/模块/cjs/loader.js:901:14) 2020-03-27T13:21:21.337518 + 00:00 app [web.1]:在Module.require(内部/模块/cjs/loader.js:1044:19) 2020-03-27T13:21:21.337518 + 00:00应用程序[web.1]:在需要时(内部/模块/cjs/helpers.js:77:18) 2020-03-27T13:21:21.337518 + 00:00 app [web.1]:在对象处。 (/app/lib/routes.js:3:14) 2020-03-27T13:21:21.337518 + 00:00 app [web.1]:在Module._compile(内部/模块/cjs/loader.js:1158:30) 2020-03-27T13:21:21.337519 + 00:00 app [web.1]:位于Object.Module._extensions..js(内部/模块/cjs/loader.js:1178:10) 2020-03-27T13:21:21.337519 + 00:00 app [web.1]:在Module.load(内部/模块/cjs/loader.js:1002:32) 2020-03-27T13:21:21.337519 + 00:00 app [web.1]:位于Function.Module._load(内部/模块/cjs/loader.js:901:14) 2020-03-27T13:21:21.337519 + 00:00 app [web.1]:在Module.require(内部/模块/cjs/loader.js:1044:19) 2020-03-27T13:21:21.337520 + 00:00 app [web.1]:需要时(内部/模块/cjs/helpers.js:77:18) 2020-03-27T13:21:21.337520 + 00:00 app [web.1]:at Object。 (/app/server.js:7:16) 2020-03-27T13:21:25.387251 + 00:00 heroku [router]:at =错误代码= H10 desc =“应用程序崩溃”方法= GET路径=“ /”主机= serene-scrubland-72461.herokuapp.com request_id = 34632d56-e244-40de-b954-6854c2b08c7f fwd =“ 86.250.193.144” dyno = connect = service =状态= 503字节=协议= https 2020-03-27T13:21:25.624603 + 00:00 heroku [router]:at =错误代码= H10 desc =“应用程序崩溃”方法= GET path =“ / favicon.ico”主机= serene-scrubland-72461.herokuapp .com request_id = 123f2cd5-5644-4b53-97d3-183248ef8a7a fwd =“ 86.250.193.144” dyno = connect = service = status = 503字节= protocol = https

1 个答案:

答案 0 :(得分:0)

使用heroku中的postgres插件解决