본문 바로가기
Developer/Node.js

npm install Error ERESOLVE unable to resolve dependency tree 해결 방법

by 김씩씩 2021. 10. 25.

npm install Error ERESOLVE unable to resolve dependency tree 해결 방법

 

npm install을 사용하여 패키지를 설치하려고 할때,

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: test@0.1.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.0.0" from react-onsenui@1.11.5
npm ERR! node_modules/react-onsenui
npm ERR!   react-onsenui@"*" 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.

위와 같이 발생할 수 있는 에러인, unable to resolve dependency tree 에러의 해결방법에 대해 알려드리도록 하겠습니다.

 

위 에러는 npm 버전 7 이상에서 peer dependency 문제에 대해 에러로 취급하기 때문에 발생합니다.

 

npm install [패키지명] --legacy-peer-deps

혹은,

npm install [패키지명] --forse

위 방법으로 패키지를 설치하시면 문제없이 설치가 진행되리라 생각됩니다.

 

--legacy-peer-deps 와 --forse의 차이는 추후에 상세히 작성하도록 하겠습니다.

 

이상으로 npm install Error ERESOLVE unable to resolve dependency tree 해결 방법 설명을 마치도록 하겠습니다.

 

 

도움이 되셨다면 공감, 댓글 부탁드립니다!

궁금하신 점이나 요청사항은 언제든지 말씀해주세요!

피드백도 언제나 환영입니다!

 

감사합니다.


댓글