본문 바로가기

Etc/Problem Solving

[Next.js] create-npx-app 설치 후 오류 Parsing error: Cannot find module 'next/babel'

728x90

npx create-next-app@latest 로 프로젝트를 설치하고 가장 먼저 마주한 것. 
ERROR ...

 

| 😱 오류내용

설치 후 확인해보니 첫 줄 부터 빨간 줄이 쳐져있었다.

 

Parsing error: Cannot find module 'next/babel'

 

| 💫 해결방안

1. 프로젝트에 .babelrc 파일을 만들어 아래와 같이 작성한다.

{
    "presets": ["next/babel"],
    "plugins": []
  }

2. .eslintrc.json 파일을 아래 코드로 수정해준다.

{
  "extends": ["next/babel", "next/core-web-vitals"]
}

[기존]

 

[수정]

 더이상 해당 오류가 발생하지 않는 것을 확인하였다.

Parsing error: Cannot find module 'next/babel' 오류 해결!

반응형