Knex:运行 `knex migrate` 时获取连接超时

Knex: Timeout acquiring a connection when running `knex migrate`

我是 运行 ./node_modules/.bin/knex migrate:latest --env local

这会导致以下错误:

> knex migrate:latest --env local

Requiring external module ts-node/register
Using environment: local
TimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
at /Users/ashok/src/super-abs/alpha/server/node_modules/knex/lib/client.js:318:17
    at tryCatcher (/Users/ashok/src/super-abs/alpha/server/node_modules/bluebird/js/release/util.js:16:23)
    at /Users/ashok/src/super-abs/alpha/server/node_modules/bluebird/js/release/catch_filter.js:17:41
    at tryCatcher (/Users/ashok/src/super-abs/alpha/server/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/ashok/src/super-abs/alpha/server/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/Users/ashok/src/super-abs/alpha/server/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/Users/ashok/src/super-abs/alpha/server/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/Users/ashok/src/super-abs/alpha/server/node_modules/bluebird/js/release/promise.js:725:18)
    at _drainQueueStep (/Users/ashok/src/super-abs/alpha/server/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/Users/ashok/src/super-abs/alpha/server/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/Users/ashok/src/super-abs/alpha/server/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/Users/ashok/src/super-abs/alpha/server/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (internal/timers.js:456:21)

我什至试过删除数据库并重新运行。

是否有我需要以某种方式清除的连接?我的应用不是 运行.

使用以下

"knex": "0.19.0",

节点-v:v14.0.0

psql (PostgreSQL) 11.7

通过简单地降级到节点版本 13.11.0 解决了这个问题:

sudo npm install -g n
sudo n 13.11.0
knex migrate:latest
#  Requiring external module ts-node/register
#  Using environment: local
#  Batch 1 run: 63 migrations

赞。

Knex: Timeout acquiring a connection. The pool is probably full...

升级 pg@8.3.0 解决了问题。
环境:
节点 14.6
pg:7.8
"knex": "^0.20.10",

https://github.com/knex/knex/issues/3912
https://github.com/knex/knex/issues/3912#issuecomment-657715661