Open Egzonrexhepi opened 3 years ago
@Egzonrexhepi if you change your scripts to:
"seed:config": "ts-node -r tsconfig-paths/register ./node_modules/typeorm-seeding/dist/cli.js config",
"seed:run": "ts-node -r tsconfig-paths/register ./node_modules/typeorm-seeding/dist/cli.js seed"
if you add -r tsconfig-paths/register
to the script will be able to run successfully.
I hope this can help you!
The path to my ormconfig file is ./src/database/ormconfig.ts
.
so i rewrote the above as "seed:config": "ts-node -r tsconfig-paths/register ./node_modules/typeorm-seeding/dist/cli.js -r=./src/database config"
but when i run yarn seed:config
I get:
$ ts-node -r tsconfig-paths/register ./node_modules/typeorm-seeding/dist/cli.js -r=./src/database config
🌱 TypeORM Seeding v1.6.1
❌ Could not find the orm config file
Error: Cannot find module './src/database/ormconfig.ts'
Hi
I recently installed typeorm-seeding into my project, and im trying to seed colors into a FormColorEntity,
My entity located in /src/form/form-color.entity.ts which is under FormModule
Here is my seeder:
I am using only .env Config like this:
And my seeders are located in src/seeds/create-colors.seed.ts
Here is my package.json config: