TypeError: utils.getKnexMigrator is not a function
at Object. (/home/peleke7/lib/node_modules/knex-migra
tor/bin/knex-migrator-migrate:9:7)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js
:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:1
2)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
Hi @Peleke! How exactly are you running into this problem? Are you using ghost-cli to update your blog instance? At what point is this error happening? Could you please provide a more reproducible scenario to get this error? Cheers!
Yes, sure. I am running Ghost self-hosted and I am using this script to update it: Ghost 3 auf Uberspace 7 per Script aktualisieren | Pelekes Blog
I didn’t change anything to the script for a while and it worked as it should for a lot of updates already.
Could it be an issue of the new knex-migrator 3.3 that I have updated before the Ghost update? This version is not yet listed on GitHub but available already on npm.
I just applied the same procedure as the last time but with knex-migrator 3.2.6 instead of 3.3.0 to update ghost from 2.23.2 to 2.23.3 and it worked as it should. So it seems to be an issue with knex-migrator 3.3.0
This is an interesting lead. I will try to have a closer look at it on Monday. Would really appreciate if you could be able to track it down to some more specific point The tests are still passing on the latest version, but now I’m a bit dubious about bumping the version in Ghost core
Hi @naz, I just updated Ghost from 2.23.3 -> 2.23.4 with knex-migrator 3.3.1 and now it shows a different error:
ERROR Cannot find module '../migrations'
Cannot find module '../migrations'
Error Code:
MODULE_NOT_FOUND
----------------------------------------
Error: Cannot find module '../migrations'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/peleke7/lib/node_modules/knex-migrator/lib/index.js:9:20)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at /home/peleke7/lib/node_modules/knex-migrator/lib/utils.js:162:20
at tryCatcher (/home/peleke7/lib/node_modules/knex-migrator/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/peleke7/lib/node_modules/knex-migrator/node_modules/bluebird/js/release/promise.js:517:31)
at Promise._settlePromise (/home/peleke7/lib/node_modules/knex-migrator/node_modules/bluebird/js/release/promise.js:574:18)
It seems that it is still not solved. Should I open a new ticket or do you want to re-open the existing one?
No need to reopen the issue, the fix is too trivial. I will reference the closed one and release a new minor in a bit Tested the package locally with yarn link and now I know one of the downsides of this approach