No matter what I do, I keep getting this error when running knex.
"errno": "EAI_AGAIN",
"code": "EAI_AGAIN",
"syscall": "getaddrinfo",
"hostname": "knex",
"host": "knex",
"port": 3
I'm connected to localhost and I'm sure I'm doing everything right. This exact setup worked when I last opened this project. I even confirmed I was on the right npm and node versions
const knexConnection = knex({
client: 'pg',
connection: "postgres://user:password@localhost:5432/db-name",
})
Putting the username, password, etc. into dbeaver works fine. So it's not an issue with the local psql server, nor is it an issue with the password and whatnot. Looking at the knex documentation too, this doesn't seem like a syntax issue.
What's going on? How can I fix this?