• 카테고리

    질문 & 답변
  • 세부 분야

    프론트엔드

  • 해결 여부

    해결됨

npm i typescript 충돌 오류

23.05.16 10:02 작성 조회수 399

0

npm i typescript 작성 시 아래와 같은 오류가 뜹니다. 종속성 해결 과정에서 충돌이 발생한 것으로 보이는데, 여기서 --force를 해서 설치를 하면 실행 될 것 같긴한데 그렇게 했을때는 결국 문제가 터졌던 경험들이 있어서 어떻게 하면 되는지 잘 모르겠습니다.

/c/02WorkSpace/sleact/alecture (master)

$ npm i typescript

npm ERR! code ERESOLVE

npm ERR! ERESOLVE could not resolve

npm ERR!

npm ERR! While resolving: react-custom-scrollbars@4.2.1npm ERR! Found: react@17.0.2

npm ERR! node_modules/react

npm ERR! peer react@">=16.8.0" from @emotion/react@11.10.6

npm ERR! node_modules/@emotion/react

npm ERR! peer @emotion/react@"^11.0.0-rc.0" from @emotion/styled@11.10.6

npm ERR! node_modules/@emotion/styled

npm ERR! @emotion/styled@"^11.1.5" from the root

project

npm ERR! @emotion/react@"^11.1.5" from the root project

npm ERR! peer react@">=16.8.0" from @emotion/styled@11.10.6

npm ERR! node_modules/@emotion/styled

npm ERR! @emotion/styled@"^11.1.5" from the root project

npm ERR! 10 more (@emotion/use-insertion-effect-with-fallbacks, ...)

npm ERR!

npm ERR! Could not resolve dependency:

npm ERR! peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from react-custom-scrollbars@4.2.1

npm ERR! node_modules/react-custom-scrollbars

npm ERR! react-custom-scrollbars@"^4.2.1" from the root project

npm ERR!

npm ERR! Conflicting peer dependency: react@16.14.0

npm ERR! node_modules/react

npm ERR! peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from react-custom-scrollbars@4.2.1

npm ERR! node_modules/react-custom-scrollbars

npm ERR! react-custom-scrollbars@"^4.2.1" from the

root project

npm ERR!

npm ERR! Fix the upstream dependency conflict, or retrynpm ERR! this command with --force or --legacy-peer-deps

npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

npm ERR!

npm ERR!

npm ERR! For a full report see:

npm ERR! C:\Users\KG.Park\AppData\Local\npm-cache\_logs\2023-05-16T00_56_02_463Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:

답변 1

답변을 작성해보세요.

1

react-custom-scrollbars가 리액트17을 피어디펜던시로 추가하지 않아서 그렇습니다. 이 경우는 force해도 되긴한데 찝찝하다면

https://www.npmjs.com/package/react-custom-scrollbars-2

이걸 대신 쓰세요.