본문 바로가기
오류노트

[오류노트] npm ERR! code ERESOLVEnpm ERR! ERESOLVE unable to resolve dependency treenpm ERR!npm ERR! While resolving: test-react@0.1.0npm ERR! Found: react@18.0.0npm ERR!

by Yikanghee 2022. 4. 12.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: test-react@0.1.0
npm ERR! Found: react@18.0.0
npm ERR! node_modules/react
npm ERR!   react@"^18.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"<18.0.0" from @testing-library/react@12.1.5
npm ERR! node_modules/@testing-library/react
npm ERR!   @testing-library/react@"^12.0.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!

React로 개발하던 중 오류를 만났다

react 버전과 사용하려는 라이브러리가 안맞을 때 생기는 오류인데 구글을 하면

npm install --force or npm install --legacy-peer-deps 을 사용하라고 하는데

나같은 경우에는 해결되지 않았다.

 

그래서 node_modules, package-lock.json 을 삭제하고,

yarn install 을 사용했더니 해결되었다.

댓글