微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

MikroORM 无法连接到 postgresql://postgres@127.0.0.1:5432 上的数据库 lireddit

如何解决MikroORM 无法连接到 postgresql://postgres@127.0.0.1:5432 上的数据库 lireddit

我已经尝试解决这个错误 5 个小时了,但是没有用。 :c 请帮帮我。

这是丑陋的控制台错误消息(我不擅长格式化 sry :c):

P:\.Projektek\lireddit-server>yarn dev
yarn run v1.22.10
$ nodemon dist/index.js
[nodemon] 2.0.7
[nodemon] to restart at any time,enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json  
[nodemon] starting `node dist/index.js`     
[discovery] ORM entity discovery started,using ReflectMetadataProvider
[discovery] - processing entity Post
[discovery] - entity discovery finished,found 1 entities,took 22 ms
[info] MikroORM Failed to connect to database lireddit on postgresql://postgres@127.0.0.1:5432
(node:8672) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:5432
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:8672) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block,or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection,use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 8)
(node:8672) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future,promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[nodemon] clean exit - waiting for changes before restart

好痛。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。