0
I’m creating an Migration from the Knex, but when I run the command
npx knex migrate:latest --knexfile knexfile.ts migrate:latest
I get the following error:
No Configuration file found and no commandline Connection Parameters passed at mkConfigObj
Already I stopped the file that the error points, are some settings of CLI.
My knexfile.ts
import path from 'path';
module.exports = {
client: 'sqlite3',
connection: {
filename: path.resolve(__dirname, 'src', 'database', 'database.sqlite')
},
migrations:{
directory: path.resolve(__dirname, 'src', 'database', 'migrations')
}
};
The knexfile.ts file has to be at the root of the project. It is likely that yours is not.
– Wilson Junior
I’ve had this problem before, and it was actually the wrong way of knexfile.ts.
– Leandro