Dopo un aggiornamento di Knex, assicurati di distruggere la connessione al termine della query, soprattutto negli script brevi o nei test.
knex(table)
.where({ id: 1 })
.then(callback)
.catch(err => callback(err))
.finally(() => knex.destroy());