생각기록

npm install 오류 (code ERESOLVE) 본문

강의 정리/React JS

npm install 오류 (code ERESOLVE)

끼록관 2023. 2. 2. 23:38
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @testing-library/react@13.4.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   peerOptional react@"^16.9.0 || ^17.0.0 || ^18" from @reduxjs/toolkit@1.9.1
npm ERR!   node_modules/@reduxjs/toolkit
npm ERR!     @reduxjs/toolkit@"^1.9.1" from the root project
npm ERR!   peer react@"17.0.2" from react-dom@17.0.2
npm ERR!   node_modules/react-dom
npm ERR!     peerOptional react-dom@"^16.8 || ^17.0 || ^18.0" from react-redux@8.0.5
npm ERR!     node_modules/react-redux
npm ERR!       peerOptional react-redux@"^7.2.1 || ^8.0.2" from @reduxjs/toolkit@1.9.1
npm ERR!       node_modules/@reduxjs/toolkit
npm ERR!         @reduxjs/toolkit@"^1.9.1" from the root project
npm ERR!       1 more (the root project)
npm ERR!     peer react-dom@">=16.8" from react-router-dom@6.8.0
npm ERR!     node_modules/react-router-dom
npm ERR!       react-router-dom@"^6.8.0" from the root project
npm ERR!     2 more (styled-components, the root project)
npm ERR!   8 more (react-redux, use-sync-external-store, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^18.0.0" from @testing-library/react@13.4.0
npm ERR! node_modules/@testing-library/react
npm ERR!   @testing-library/react@"^13.4.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: react@18.2.0
npm ERR! node_modules/react
npm ERR!   peer react@"^18.0.0" from @testing-library/react@13.4.0
npm ERR!   node_modules/@testing-library/react
npm ERR!     @testing-library/react@"^13.4.0" 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\JMK\AppData\Local\npm-cache\eresolve-report.txt for a full report.

https://velog.io/@rmaomina/upstream-dependency-conflict

 

npm 업스트림 종속성 에러와 해결

upstream dependency conflict 에러. 팀 프로젝트에서 필요한 라이브러리 설치 후, 프로젝트를 클론하는 과정에서 에러를 만났다. peerDependencies 와 충돌 해결 방법 회고

velog.io

 

이오류가 버전 문제인것같은데.. 정확히 뭔지 모르겟다

 --legacy-peer-deps 를 붙여 하면 되었다.

npm install react-iamport --legacy-peer-deps