• 카테고리

    질문 & 답변
  • 세부 분야

    프로그래밍 언어

  • 해결 여부

    해결됨

ts-node extends시 에러가 발생합니다 ㅠㅠ

23.11.30 23:52 작성 23.12.01 17:32 수정 조회수 369

0

tsconfig.json에서

"extends": "@tsconfig/node16/tsconfig.json",

extends를 하고 다시 ts-node 명령어를 실행하면 아래와 같이 에러가 발생합니다.

tsconfig.json을 주석처리하고 ts-node를 하면 잘 수행됩니다..!

 

/usr/local/lib/node_modules/ts-node/src/index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
error TS6053: File '@tsconfig/node16/tsconfig.json' not found.

    at createTSError (/usr/local/lib/node_modules/ts-node/src/index.ts:859:12)
    at reportTSError (/usr/local/lib/node_modules/ts-node/src/index.ts:863:19)
    at createFromPreloadedConfig (/usr/local/lib/node_modules/ts-node/src/index.ts:874:36)
    at phase4 (/usr/local/lib/node_modules/ts-node/src/bin.ts:543:44)
    at bootstrap (/usr/local/lib/node_modules/ts-node/src/bin.ts:95:10)
    at main (/usr/local/lib/node_modules/ts-node/src/bin.ts:55:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/ts-node/src/bin.ts:800:3)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32) {
  diagnosticCodes: [ 6053 ]
}

현재 노드 버전 : v17.0.1

노드를 완전 삭제 및 다시 설치해도 동일한 현상이 발생하고

노드 버전을 올리고 내려도 동일한 현상이 발생하네요..

혹시 해당 에러가 왜 발생할까요? ㅠㅠ

검색을 해도 잘 나오지가 않네요 ㅠㅠ

답변 1

답변을 작성해보세요.

0

앙빙빙님의 프로필

앙빙빙

질문자

2023.12.01

자문 자답입니다!

 

노드가 처음이라 많이 헤맸네요 ㅠㅠ

"extends": "@tsconfig/node16/tsconfig.json",

해당 값에 ctrl 클릭하면 프로젝트 내의 node_modules로 잘 이동되어서 노드 버전을 의심했었네요 ㅠㅠㅠ

 

프로젝트 내에 node_modules가 존재하는데

글로벌 node_modules를 읽으려고 하여

프로젝트 내의 node_modules를 읽도록 tsconfig.json을 수정하였습니다..!