Make sure you have ts-node installed: npm install ts-node
This creates a .ts file in migrations directory
npm run knex:migrate:make -- some-migration-name
npm run knex:migrate:latest
npm run knex:migrate:rollback
knexfile.tsrequiresrequire('ts-node/register');to work.- ES6/ES2015 module syntax does not work in knexfile or in any files that it
require()s
@sahina For me this was fixed by changing a property in my tsconfig.
"module"was set to"esnext"and I changed it to"commonjs"and then it worked.