React.js

[React] ERESOLVE unable to resolve dependency tree 에러

Chunho 2022. 5. 31. 12:58

react-simple-image-viewer를 설치하는 중 아래와 같은 에러가 발생했다. 

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: baro-web-v2@1.0.0
npm ERR! Found: react@16.14.0
npm ERR! node_modules/react
npm ERR!   react@"^16.6.3" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.0" from react-simple-image-viewer@1.2.1
npm ERR! node_modules/react-simple-image-viewer
npm ERR!   react-simple-image-viewer@"*" 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.

명령어 뒤에 --legacy-peer-deps를 붙이면 해결할 수 있다.