Knex在迁移时出现PG客户端错误

时间:2019-03-15 11:08:21

标签: node.js postgresql knex.js

我是Knex的新手,这是我无法迁移环境的代码,有人可以解释错误原因

development: {
  client: 'pg',
  connection: {
    host: 'localhost',
    user: 'root',
    password: 'root',
    port: 8889,
    database: 'tuitionBuzz'
  },
  pool: {
    min: 0,
    max: 10,
  },
  acquireConnectionTimeout: 10000,
  migrations: {
    directory: __dirname + '/db/migrations',
  },
  seeds: {
    directory: __dirname + '/db/seeds',
  },
}

迁移时出错

npx knex migrate:rollback
Using environment: development
/Users/mohdmaroof/Desktop/tuitionBuzz Node.js web/node_modules/pg/lib/connection.js:121
      var eventName = msg.name === 'error' ? 'errorMessage' : msg.name
                          ^

TypeError: Cannot read property 'name' of undefined
    at Socket.<anonymous> (/Users/mohdmaroof/Desktop/tuitionBuzz Node.js web/node_modules/pg/lib/connection.js:121:27)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at TCP.onread (net.js:638:20)

0 个答案:

没有答案