기록
'next' 모듈을 찾을 수 없습니다. 본문
next.js 를 설치했는데 다음과 같은 에러가 떴다.
모듈을 찾을 수 없다고 한다.
모듈을 찾는 방법을 다르게 설정해야 한다.
moduleResolution을 node로 설정하면 node_modules 폴더에서 모듈을 검색한다.
그래서 tsconfig.json을 다음과 같이 수정한다.
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
// "moduleResolution": "bundler", 이 부분을
"moduleResolution": "node", // 이렇게 변경
'TIL*' 카테고리의 다른 글
npm, yarn, yarn berry 등 정리 (0) | 2023.08.18 |
---|---|
[yarn 에러] Usage Error: The nearest package directory (/최상위폴더/유저이름/폴더) doesn't seem to be part of the project declared in /최상위폴더/유저이름. (0) | 2023.08.18 |
nvm 설치 도중 알게 된 .zshrc 에러 (0) | 2023.08.16 |
인프런 초보 백엔드 개발자 로드맵 강의 수강 (0) | 2023.06.21 |
Vim (0) | 2023.06.15 |
Comments