[React] 버전 낮추는 방법

Hayley·2022년 1월 9일
0

react-reveal를 설치하려고 하다 만난 에러

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: tesla-clone@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@"^15.3.0 || ^16.0.0" from react-reveal@1.2.2
npm ERR! node_modules/react-reveal
npm ERR!   react-reveal@"*" 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 install --save react@^16.14.0 react-dom@16.14.0

위 코드로 버전을 다운그레이드하고 해결


참고한 블로그: https://d-life93.tistory.com/309

profile
👩🏻‍💻✍🏻

0개의 댓글