seed ์์ฑ ์๋ฌ
781
์์ฑ์ ์์
0 asked
์๋ ํ์ธ์.
npm run seed:run ์ํ๋ฉด
๐ฑ TypeORM Seeding v1.6.1
โ Could not load the config file!
TypeORMError: No connection options were found in any orm configuration files.
์ด๋ฐ ์๋ฌ๊ฐ ๋ฐ์ํด์
์ ๋ก์ด๋ ๊นํ๋ธ๋ก ์ ๋ถ ๋ณต์ฌํด๋ ๋๊ฐ์ด ํด๊ฒฐ์ด์๋๋๋ฐ ์ด์ ๋ฅผ ํน์ ์์๋์?
๋ฉ์ธ์ง๋ฅผ ๋ณด๋ฉด ormconfig.ts๋ฅผ ๋ชป์ฐพ๋๊ฑฐ๊ฐ์์.
.env๋ ์ ๋ ฅํ๊ณ ํ๋ก ํธ๋ ๋ค์ด์ ๊ฐ์๊ทธ๋๋ก ์๋์์ฑ ์งํํ๊ณ , entitiesํด๋๋ ๊นํ๋ธ๋ก ๋ฐ๊ฟจ์ด์. ๊ทธ๋ฆฌ๊ณ package.json, ormconfig,create-initial-data ์ด๋ฐ๊ฑฐ ์ ๋ถ ๋ณต์ฌํด์ ๋ค์ ํด๋ณด๊ณ ๊ฒฝ๋ก๋ ๋ง์์ ์คํ๋ฌธ์ ๋ ์๋๊ฑฐ๊ฐ์๋ฐ..
forRoot()๋ถ๋ถ์ ์ต์ ์ ์ง์ ๋ฃ์ด๋ณด๊ธฐ๋ ํ๊ณ
์ํฐํฐ๋ถ๋ถ์
entities: ["entities/*.js"] ์ด๊ฑฐ๋ ํด๋ณด๊ณ
entities: ["dist/**/**.entity{.ts,.js}"] ์ด๋ ๊ฒ ๋ฐ๊ฟ๋ณด๊ธฐ๋
package.json์ typeorm๋ถ๋ถ์
"typeorm": "ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js --config src/ormconfig.ts",
์ด๋๊ฒ ๋ฐ๊ฟ๋ณด๊ธฐ๋ ํ๋๋ฐ ์๋ฌ๋ ๊ทธ๋๋ก ์ฌ์ ์ ๋ชจ๋ฅด๊ฒ ๋ค์ฉ
Answer 4
0
๐ฑ TypeORM Seeding v1.6.1
โ Could not load the config file!
TypeORMError: No connection options were found in any orm configuration files.
์๋ฌ ์์ธ
ormconfig.ts์ ๋ฐ์ผ๋ก ๋นผ์ ์ค์ ํด์ฃผ์ง ์์ผ๋ฉด ์๋ฌ๊ฐ ๋ฐ์ํ๋ค์
0
Error: Nest can't resolve dependencies of the ShopsService (ShopsRepository, ?). Please make sure that the argument UsersRepository at index [1] is available in the ShopsModule context.
Potential solutions:
- If UsersRepository is a provider, is it part of the current ShopsModule?
- If UsersRepository is exported from a separate @Module, is that module imported within ShopsModule?
@Module({
imports: [ /* the Module containing UsersRepository */ ]
})
์ ๋ก์ด๋ ์ด๋ถ๋ถ์ด ์ ์๋ฌ๊ฐ ๋๋๊ฒ์ผ๊น์..? ๊ฐ์๋ค์ผ๋ฉด์ ๊ถ๊ธํ์ต๋๋ค..
0
์ ๋ก์ด๋ ํน์ npm i typeorm-seeding ํ์ฌ ์ด ๋ช ๋ น์ด๊ฐ ๋จนํ์ง ์์์ ๊ทธ๋ฌ๋๋ฐ ๋ฒ์ ์ด ์ ๋ฐ์ดํธ๋๊ฒ์ผ๊น์ ?
0
npm err! ํ๋ฉด์ ์๋ฌ๊ฐ ๋์ค๋๋ฐ ์ ๊ฐ ์์ธํ๊ฒ ์บก์ณํด์ ๋๋ฆด๊ฒ์ ใ ใ
0
์ ๋ก์ด๋ ๊ทธ๋ฆฌ๊ณ ํ๋๋ง ๋ ์ฌ์ญค๋ด๋๋ ๊น์ ?
0
๊ทธ๋ฐ๋ฐ service์ชฝ์ ์ด๋ ๊ฒ ๋ฃ์ด์ฃผ๋ฉด .where('tbl_user.email = :email', { email: 'dfadsfa@dafassaf.com'})
0
0
--config ๋ถ๋ถ์ typeorm ๋ช ๋ น์ด ๋ง๊ณ seed:run์ ์ถ๊ฐํด๋ณด์ธ์.
๊ทธ๋ฆฌ๊ณ .env์ ๋ค์๊ฒ ๋ง๊ณ ๋ db ์ฐ๊ฒฐ ์ ๋ณด๋ ๋ค์ด์์ผ์ ๊ฐ์?
TYPEORM_SEEDING_FACTORIES=src/factories/**/*{.ts,.js}
TYPEORM_SEEDING_SEEDS=src/seeds/**/*{.ts,.js}
0
์.. ์ ๊นํ๋ธ๋ก ํด๋ณด๋ ๋ฉ๋๋ค. ใ ใ ์ฝ๋์ ๋ฒ์ ์ด ๊ฐ์์ง ํ ๋ฒ ๋ ํ์ธํด์ฃผ์ธ์.
๊ฐ์์๋ฃ๋ ์ด๋์ ๋ค์ด๋ฐ๋์?
0
143
4
์ง๋ฌธ ์์ต๋๋ค.
0
317
3
์ฝ๋ ํธ์ง๊ธฐ ํ์ฅ ํ๋ก๊ทธ๋จ
0
220
2
(์ง๋ฌธ)๋น๋ฐ ์ ์ฅ์์ ์ ๊ทผํ๊ธฐ ์ํ ์ธ์ฆ ์ ๋ณด๋ ๋ก์ปฌ .env์ ์ ์ฅํ๋์ง?
0
162
2
(์ง๋ฌธ)์ธ๋ถ ์ ์ฅ์๋ฅผ ํตํ ํ๊ฒฝ๋ณ์ ๋ถ๋ฌ์ค๊ธฐ ๋น๋๊ธฐ ์ง๋ฌธ
0
178
3
๋ก๊ทธ์ธ์ ํด๋ LoggedInGuard์ชฝ์์ false๊ฐ์ด ๋์ต๋๋ค.
0
161
2
๋ก๊ทธ์ธ๋ฐฉ๋ฒ์ด ๊ณ ๋ฏผ๋ฉ๋๋ค.
0
197
2
yarn seed ๋ช ๋ น์ด ์คํ ์ ๋ฐ์ดํฐ ์ฝ์ ์๋จ
0
305
4
yarn run db:create ์์ ๋ฐ์ํ๋ ๋ฐ์ฝ๋ ์ดํฐ ์ค๋ฅ
0
248
2
npm run db:create ์์ ๋ฐ์ํ๋ decorating ์ค๋ฅ
0
245
2
RxJS ๋๋ฒ๊น ์ง๋ฌธ ์์ต๋๋ค.
0
198
3
CacheManager์ ๋ํด ์ง๋ฌธ ์์ต๋๋ค.
0
184
2
๋ก๊น ์ ์ด๋ป๊ฒ ํ๋๊ฒ ํจ์จ์ ์ผ๊น์?
0
238
1
CORS ์ง๋ฌธ ์์ต๋๋ค.
0
426
2
์ฟ ํค ์ต์ ์ ๋ํด์ ์ง๋ฌธ ์์ต๋๋ค.
0
190
2
๋ก๊ทธ์์ ์์ฒญ์ด 403 forbidden ์๋ฌ๊ฐ ๋๋๋ฐ ์๊ทธ๋ฐ๊ฑธ๊น์??
0
458
1
401 unauthorized๋ฌธ์
0
305
1
๊ฐ๋์ ์ฅ์ ์ ๋ํด์ ์ง๋ฌธ์ด ์์ต๋๋ค.
0
232
1
๋ก๊ทธ ๊ด๋ฆฌ์ ๋ํด ์ง๋ฌธ ์์ต๋๋ค.
0
255
2
CORS ์๋ฌ ์ง๋ฌธ ์์ต๋๋ค.
0
328
2
๋ฐฐํฌ ํ๊ฒฝ DB ์ฐ๊ฒฐ ์ง๋ฌธ ์์ต๋๋ค.
0
417
2
socket io ๋ฏธ ์ฐ๊ฒฐ ๋ฌธ์ (nest & flutter)
1
1166
3
no elements in sequence ์๋ฌ ๊ดํด์ ์ง๋ฌธ์ด ์์ต๋๋ค.
0
464
1
start:dev-backup์ผ๋ก ๋๋ฆฌ๋ฉด ํซ ๋ฆฌ๋ก๋ฉ์ด ๋์ ์ ์์ธ๊ฐ์?
0
324
1

