우선 compilerOptions의 moduleResolution을 node로 설정해준다.
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
...
}
}
만약 이 경우에도 에러가 발생한다면 해당 모듈에 필요한 type이 제대로 정의돼있는지 확인해본다.
예를들어 Cannot find module 'path' 이라면 npm install --save-dev @types/node 로 해결해준다
'trouble-shooting' 카테고리의 다른 글
| 크롬 익스텐션의 CSP (Content Security Policy) (0) | 2024.11.28 |
|---|---|
| git clone 오류 error: invalid path (0) | 2024.11.26 |
| 크롬 익스텐션 vite.config.ts 작성하며 생긴 문제 (1) | 2024.11.22 |
| Mac에서 java버전 바꾸기 (0) | 2024.11.13 |
| Unable to resolve your shell environment: Unexpected exit code from spawned shell (code 9, signal null) 문제 해결 (0) | 2024.11.11 |