1

我需要帮助才能将我的项目部署到 Heroku。每次我尝试部署我的项目时,我都会收到此错误:

Error: no pg_hba.conf entry for host "104.57.187.158", user "epcifomwotivdd", database "dummyDB12", SSL off
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! barhop-api@1.0.0 migrate: `postgrator --config postgrator-config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the barhop-api@1.0.0 migrate script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Juan Mireles\AppData\Roaming\npm-cache\_logs\2021-01-23T21_21_52_677Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! barhop-api@1.0.0 migrate:production: `env SSL=true DATABASE_URL=dummyDB npm run migrate`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the barhop-api@1.0.0 migrate:production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Juan Mireles\AppData\Roaming\npm-cache\_logs\2021-01-23T21_21_52_760Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! barhop-api@1.0.0 predeploy: `npm audit && npm run migrate:production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the barhop-api@1.0.0 predeploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Juan Mireles\AppData\Roaming\npm-cache\_logs\2021-01-23T21_21_52_809Z-debug.log

我尝试将主机添加到 并将设置pg_hba.conf更改postgresql.conf为接受所有主机。

这是我的pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
host    all             all             0.0.0.0/0               trust #inserted
# IPv6 local connections:
host    all             all             ::0/0                   trust #inserted
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     trust
host    replication     all             127.0.0.1/32            trust
host    replication     all             ::1/128                 trust
host    all             all             0.0.0.0/0               trust #inserted

我尝试以不同的方式添加和删除插入的主机,但我无法让它工作。此外,随着我​​所做的每一次更改,我都重新启动了服务器。我确实看到了其他一些可以尝试的选项,但它们适用于 Mac,而我使用的是 Windows 计算机。

4

0 回答 0