[Error] tsconfig 에러, Mac에서 vscode 업데이트 안될 때

이지·2024년 6월 22일
1

ERROR

목록 보기
4/5
post-thumbnail

💥 문제 발생

Next.js + TypeScript 프로젝트를 생성하고 아무것도 안 한 상태인데 다음과 같이 에러가 발생하였다.
(에러가 뜬 상태에서 npm run dev을 진행하면 문제 없이 잘 실행되었음)

Cannot find module 'next'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?

시도 1 : Node로 변경

'moduleResolution': 'Node'로 변경했을 때 에러가 사라지는 것을 볼 수 있었다. 하지만 기존의 세팅의 경우 bundler로 되어 있기 때문에 무엇인가 찜찜했다.

해당 블로그를 통해 TypeScript 5 이상부터는 bundler 옵션을 선택할 수 있다는 사실을 알게 되었다.
그리고 위의 블로그에서 vscode 이전 버전을 사용하게 되면 발생하는 에러라는 것을 보고 vscode 업데이트를 시도했다.

시도 2 : vscode 업데이트

Cannot update while running on a read-only volume. The application is on a read-only volume. Please move the application and try again. If you're on macOS Sierra or later, you'll need to move the application out of the Downloads directory. This might mean the application was put on quarantine by macOS. See this link for more information.

이러한 메시지가 떴는데 현재 내 맥북에서 vscode가 Applications가 아닌 Downloads 폴더에 있어서 발생한 문제였다.

위의 메시지에서 나타난 링크를 따라 들어가면 해당 문제와 관련된 closed 이슈를 확인할 수 있는데 vscode를 Applications 폴더로 옮겨도 업데이트가 안돼서 2번째 방법도 진행했지만 안됐다.

[VSCode] MAC 환경에서 VSCode의 업데이트 오류 발생시 방법를 참고해서 캐시를 삭제해줬다.

rm -rf ~/Library/Caches/com.microsoft.VSCode/*

vscode 종료 후 재시작하고나니 vscode 업데이트가 가능해졌다.

그리고 이제 에러 메시지가 더이상 뜨지 않는다! 🥳

0개의 댓글