[NestJS] Can't find module 'entity' from 'service.ts' 에러
Node.js2022. 8. 12. 00:15[NestJS] Can't find module 'entity' from 'service.ts' 에러

NestJS에서 엔티티 위치를 찾을 수 없다는 말입니다. 주로 entity를 찾을 수 없다고 나오지만 이는 "경로 지정이 잘못되었을 때" 나오는 에러입니다. 에러 발생 포인트: 레퍼지토리를 연결하여 CRUD 메소드를 만든 후(Entity 연동 후), Test를 돌려보니 에러가 남. 에러 원인: tsconfig.json과 pakage.json의 모듈 네임 매퍼가 같지 않음. tsconfig.json "jest": { "moduleDirectories": [ "node_modules", "src" ], "moduleFileExtensions": [ "js", "json", "ts" ], "roots": ["","src"], "testRegex": ".*\\.spec\\.ts$", "transform": { ..

반응형
image