javascript 错误:在TCPConnectWrap连接ECONREFUSED::1:5432,afterConnect [as oncomplete](node:net:1300:16) | 您所在的位置:网站首页 › tcpconnectwrap › javascript 错误:在TCPConnectWrap连接ECONREFUSED::1:5432,afterConnect [as oncomplete](node:net:1300:16) |
我正在尝试连接到PostreSQL数据库。我正在使用JavaScript,TypeScript,NestJS和TypeORM。我在pgAdmin 4中创建了数据库。一切正常,直到我更改了一些与应用程序功能有关的代码,而不是服务器。我添加的代码也是有效的,应该不会导致问题。在app.module.ts中,我有TypeOrmModule的代码: TypeOrmModule.forRoot({ type: 'postgres', host: 'localhost', port: 5432, username: 'postgres', password: 'my_password', database: 'database_name', entities: [NewsEntity], synchronize: true, }),这就是控制台的样子: [Nest] 55824 - 08.03.2023, 13:08:04 ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)... Error: connect ECONNREFUSED ::1:5432 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16)我正在运行Windows 11,使用Nodemon运行应用程序并使用PostgreSQL 14。这里还有我安装的版本(可能与错误有关): "@nestjs/typeorm": "^9.0.1", "rxjs": "^7.8.0", "typeorm": "^0.3.12", "@types/node": "18.11.18",我期待一个正常的服务器启动与连接到数据库建立像以前一样.我试图连接到服务器从pgAdmin 4但它抛出相同的错误,并拒绝连接.请帮助 |
今日新闻 |
推荐新闻 |
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 |