Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- 문자열보간법
- ERESOLVE
- 로스트치킨샐러드
- 내일의주인공은나야나
- 아이행복해
- 러닝자바스크립트
- 노드 버전
- GitLab
- 서브웨이
- 자고싶다
- javascript
- 카드지갑
- 취미
- useMemo
- 프라모델
- 전복과붕어빵
- 정처기
- 후록스
- 샐러드좋아
- 면담끝
- styled-components install error
- 가죽공예
- Git
- node version update
- 오늘양짱많음
- 너무무서워
- 상수와변수
- 기본데이터타입
- 찐대졸
- 커링
Archives
- Today
- Total
당근농장
[React-Native] styled-components unable to resolve dependency tree 본문
개발/ReactNative
[React-Native] styled-components unable to resolve dependency tree
devcarrot 2022. 4. 26. 22:21npm 을 사용하여 styled-components 를 install 했을 때 나타나는 종속성 에러.
npm install --save styled-components
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: FirstApp@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.
해결 방법은 에러 로그에 나와있는 것처럼 --force 또는 --lagacy-peer-deps 옵션을 사용하면 된다.
나는 force는 괜히 무서워서 --lagacy-peer-deps 옵션을 사용했다 ㅋ
npm install --save styled-components --legacy-peer-deps
굳 👍🏻
+ 추가
해당 에러 이후 위와 같은 방법으로 @types/styled-components 를 install할 때는 에러 해결이 되지 않았다.
그래서 그냥 --force로 해결해버렸다.
--legacy-peer-deps와 --force의 차이점은 해당 링크 참고
Comments