#Run migrations with typeorm?

1 messages · Page 1 of 1 (latest)

cerulean zephyr
#

Hey there, trying to transition from Node to Bun on my NestJS project, but I'm afraid I don't know what I need to change to be able to run Typeorm CLI commands.
at the moment im trying to use migration:generate but its not working.

Script:
"migration:generate": " typeorm migration:generate --dataSource ./src/db/ormconfig.ts ./src/db/migrations/rooManager",

Output:

Error during migration generation:
17 |         try {
18 |             ;
19 |             [dataSourceFileExports] = await (0, ImportUtils_1.importOrRequireFile)(dataSourceFilePath);
20 |         }
21 |         catch (err) {
22 |             throw new Error(`Unable to open file: "${dataSourceFilePath}". ${err.message}`);
                       ^
error: Unable to open file: "/home/diogop/Documents/GitHubProjects/roomanager-backend-api/src/db/ormconfig.ts". Cannot find module "/home/diogop/Documents/GitHubProjects/roomanager-backend-api/src/db/ormconfig.ts" from "/home/diogop/Documents/GitHubProjects/roomanager-backend-api/node_modules/typeorm/util/ImportUtils.js"
      at /home/diogop/Documents/GitHubProjects/roomanager-backend-api/node_modules/typeorm/commands/CommandUtils.js:22:19

any help is welcome ^^

#

might this be because of the whole "its ts not js" thing going on with TypeORM ?

cerulean zephyr
#

bump

vast void
#

You woul probably get more support via github, I doubt the bun community on Discord will be able to give deep details