본문 바로가기
쬬의 React

리액트 네이티브 styled-components unable to resolve dependency tree 오류 해결!

by Joooooooo 2023. 8. 3.
반응형

리액트 네이티브 styled-components unable to resolve dependency tree 오류 해결! 

 

 

 

이런 에러를 발견했다.

분명 종속성 문제인데 개발을 하다보면 작업하다 중간에 버전문제때문에 열받는 경우가 너무 많다...

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: firstcli@0.0.1
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"17.0.2" from the root project
npm ERR!   peer react@">= 16.8.0" from styled-components@5.3.5
npm ERR!   node_modules/styled-components
npm ERR!     styled-components@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^18.0.0" from react-dom@18.0.0
npm ERR! node_modules/react-dom
npm ERR!   peer react-dom@">= 16.8.0" from styled-components@5.3.5
npm ERR!   node_modules/styled-components
npm ERR!     styled-components@"*" 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.
npm ERR!
npm ERR! See C:\Users\joeun2\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\joeun2\AppData\Local\npm-cache\_logs\2022-04-02T13_49_59_074Z-debug-0.log

해결 방법

npm install --force

npm install --legacy-peer-deps

npm config set legacy-peer-deps true

 

 

 

버전이 달라 종속성에 문제가 생기더라도 버전관계를 무시해준다!

반응형