본문 바로가기
Recap/에러 해결 기록

Could not resolve dependency:npm ERR! peer next@"^12 || ^13" from next-contentlayer@0.3.4

by yerin.dev 2024. 2. 16.
code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: my-blog@0.1.0
npm ERR! Found: next@14.1.0
npm ERR! node_modules/next
npm ERR!   next@"14.1.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer next@"^12 || ^13" from next-contentlayer@0.3.4
npm ERR! node_modules/next-contentlayer
npm ERR!   next-contentlayer@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

 

 

Next.js에 Contentlayer 설치 중 뜬 오류.
가장 깔끔한 해결책은 여기에서 확인 할 수 있다.

 

 

// package.json

"overrides": {
    "next-contentlayer": {
      "next": "$next"
    }
  }

 

 

package.json에 저 코드들을 추가해주면 된다.