인프런 커뮤니티 질문&답변

진승이님의 프로필 이미지
진승이

작성한 질문수

Slack 클론 코딩[백엔드 with NestJS + TypeORM]

제네레이트 마이그레이션 오류

해결된 질문

작성

·

382

·

수정됨

0

yujinseung@yujinseung-ui-MacBookPro slack_nest % npm run db:generate-migration

> study_nest@0.0.1 db:generate-migration
> npm run typeorm migration:generate -- ./src/migrations -d ./dataSource.ts


> study_nest@0.0.1 typeorm
> typeorm migration:generate ./src/migrations -d ./dataSource.ts

Error during migration generation:
Error: Unable to open file: "/Users/yujinseung/Desktop/slack_nest/dataSource.ts". Cannot use import statement outside a module
    at CommandUtils.loadDataSource (/Users/yujinseung/Desktop/slack_nest/node_modules/typeorm/commands/CommandUtils.js:22:19)
    at async Object.handler (/Users/yujinseung/Desktop/slack_nest/node_modules/typeorm/commands/MigrationGenerateCommand.js:68:26)
yujinseung@yujinseung-ui-MacBookPro slack_nest % npm run db:migrate

> study_nest@0.0.1 db:migrate
> npm run typeorm migration:run -- -d ./dataSource.ts


> study_nest@0.0.1 typeorm
> typeorm migration:run -d ./dataSource.ts

Error during migration run:
Error: Unable to open file: "/Users/yujinseung/Desktop/slack_nest/dataSource.ts". Cannot use import statement outside a module
    at CommandUtils.loadDataSource (/Users/yujinseung/Desktop/slack_nest/node_modules/typeorm/commands/CommandUtils.js:22:19)
    at async Object.handler (/Users/yujinseung/Desktop/slack_nest/node_modules/typeorm/commands/MigrationRunCommand.js:41:26)

위 두 오류가 뜹니다..! 뭐가문제일까요..ㅠㅠ

답변 1

진승이님의 프로필 이미지
진승이
질문자

감사합니다!

진승이님의 프로필 이미지
진승이

작성한 질문수

질문하기