본문 바로가기

[Dev] 🎯Self Study/[코딩] 너 또 오류나 ? error 모음집

[너 또 오류나? tsc시 오류] TS2403: Subsequent variable declarations must have the same type.

이정도면 오류 게시판을 새로 파야겠다... (진짜 7일뒤에 팠ㄷㅏ )

 

아무튼 tsc 즉 ts로 컴파일을 하다가 오류가 발생했다. 

 

 

 

되게 긴 에러였지만 해결법은 간단했다.

 

 npm i -d @types/node

뭔가 계속 나오지만 겁먹지 말고 기다리면 된다.

 

그 다음에, 다시 tsc index.ts를 해줬다. 

(기존에 있던 js는 삭제 후 진행했다.)

 

 

오류없이 깔끔하게 동작했다!

 

 

참고 ) 

 

Issue with TS4.9 - 'AbortSignal' was also declared here. · Issue #51567 · microsoft/TypeScript

Bug Report After upgradeing to Typescript 4.9 I get now this error. [20:27:02] Starting compilation in watch mode... node_modules/@types/node/globals.d.ts:72:13 - error TS2403: Subsequent variable ...

github.com