knex / knex

A query builder for PostgreSQL, MySQL, CockroachDB, SQL Server, SQLite3 and Oracle, designed to be flexible, portable, and fun to use.
https://knexjs.org/
MIT License
19.37k stars 2.13k forks source link

`knex migrate:up` gives error `TypeError: initKnex(...).migrate.up is not a function` #3558

Closed nikitamankovskii closed 4 years ago

nikitamankovskii commented 4 years ago

Hello, i need to make a single migration, when i tried knex migrate:up filename.js:

TypeError: initKnex(...).migrate.up is not a function
    at Command.<anonymous> (/home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/bin/cli.js:205:18)
    at Command.listener (/home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/node_modules/commander/index.js:360:8)
    at Command.emit (events.js:209:13)
    at Command.parseArgs (/home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/node_modules/commander/index.js:799:12)
    at Command.parse (/home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/node_modules/commander/index.js:563:21)
    at Liftoff.invoke (/home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/bin/cli.js:344:13)
    at Liftoff.execute (/home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/node_modules/liftoff/index.js:201:12)
    at module.exports (/home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/node_modules/flagged-respawn/index.js:51:3)
    at Liftoff.<anonymous> (/home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/node_modules/liftoff/index.js:191:5)
    at /home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/node_modules/liftoff/index.js:149:9
    at /home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/node_modules/v8flags/index.js:138:14
    at /home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/node_modules/v8flags/index.js:41:14
    at /home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/node_modules/v8flags/index.js:53:7
    at processTicksAndRejections (internal/process/task_queues.js:75:11)

also some info:

$ knex --version
Knex CLI version: 0.20.3
Knex Local version: 0.14.6
$ npm -v
6.10.3
$ node -v
v12.10.0
kibertoad commented 4 years ago

Knex local seems outdated, can you update it?

nikitamankovskii commented 4 years ago

@kibertoad you right? but still having this:

/home/username/Desktop/scripts/project/node_modules/tarn/lib/Pool.js:63
                throw new Error(`Tarn: unsupported option opt.${key}`);
                ^

Error: Tarn: unsupported option opt.requestTimeout
    at new Pool (/home/username/Desktop/scripts/project/node_modules/tarn/lib/Pool.js:63:23)
    at Client_MySQL.initializePool (/home/username/Desktop/scripts/project/node_modules/knex/lib/client.js:326:17)
    at Client_MySQL.Client (/home/username/Desktop/scripts/project/node_modules/knex/lib/client.js:68:12)
    at new Client_MySQL (/home/username/Desktop/scripts/project/node_modules/knex/lib/dialects/mysql/index.js:21:10)
    at Knex (/home/username/Desktop/scripts/project/node_modules/knex/lib/knex.js:52:28)
    at initKnex (/home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/bin/cli.js:75:10)
    at Command.<anonymous> (/home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/bin/cli.js:204:17)
    at Command.listener (/home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/node_modules/commander/index.js:360:8)
    at Command.emit (events.js:209:13)
    at Command.parseArgs (/home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/node_modules/commander/index.js:799:12)
    at Command.parse (/home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/node_modules/commander/index.js:563:21)
    at Liftoff.invoke (/home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/bin/cli.js:344:13)
    at Liftoff.execute (/home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/node_modules/liftoff/index.js:201:12)
    at module.exports (/home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/node_modules/flagged-respawn/index.js:51:3)
    at Liftoff.<anonymous> (/home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/node_modules/liftoff/index.js:191:5)
    at /home/username/.nvm/versions/node/v12.10.0/lib/node_modules/knex/node_modules/liftoff/index.js:149:9

i tried this, but i though its same error, my bad

kibertoad commented 4 years ago

Check tarn.js documentation for supported options, you are passing wrong pooling parameter in your connection config.

nikitamankovskii commented 4 years ago

yeah, it is. thank you so much, closing issue