I have been following Ben Awad's comprehensive full stack tutorial: youtube tutorial link. At around the 30-minute mark, things become relevant.
Encountering an issue with the command npx mikro-orm migration:create
.
Error: MikroORM config file not found in ['./dist/mikro-orm.config.js', './mikro-orm.config.js']
at Function.getConfiguration (/Users/username/lireddit-server/node_modules/@mikro-orm/core/utils/ConfigurationLoader.js:44:15)
at async Function.getORM (/Users/username/lireddit-server/node_modules/@mikro-orm/cli/CLIHelper.js:22:25)
at async Function.handleMigrationCommand (/Users/username/lireddit-server/node_modules/@mikro-orm/cli/commands/MigrationCommandFactory.js:68:21)
The error seems to be related to searching for './mikro-orm.config.js' which does not appear to exist, instead of './mikro-orm.config.ts' which is present and displayed below.
We do have a 'mikro-orm.config.ts' file:
*(contents of the file imported from here)*
It's worth noting that the 'pattern' is used in the tutorial, but I utilized 'glob' as 'pattern' has been deprecated.
In the 'package.json' file, particular attention should be paid to the 'mikro-orm' object.
{ *(contents of package.json displayed here)* }
This is the index.ts file:
{ *(contents of index.ts shown here)* }
Also, this is what 'post.ts' looks like:
{ *(contents of post.ts provided here)* }
If anyone can offer assistance, it would be greatly appreciated! Thank you:)