React

[React 설치 중 오류]npm install npm ERR! code ERESOLVE

클레인 2022. 12. 4.
반응형

개발중이던 React 프로젝트를 Github 에 올렸다가 Pull을 받아서 "npm install" 명령어로 라이브러리를 받던 도중 아래와 같은 오류가 발생했다.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: gatsby-starter-ghost@2.0.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@"^16.9.0" from @tryghost/helpers-gatsby@1.0.56
npm ERR! node_modules/@tryghost/helpers-gatsby
npm ERR!   @tryghost/helpers-gatsby@"1.0.56" 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 /Users/korECM/.npm/eresolve-report.txt for a full report.
​
npm ERR! A complete log of this run can be found in:
​
 ERROR
​
Command failed with exit code 1: npm install

내용을 보니 라이브러리마다 버전에 대한 의존성 Tree에 문제가 발생했다는 메시지였다.

이에 대한 해결은 npm install 할 때 --force 또는 --legacy-peer-deps와 함께 실행하는 것이다.

정리하면, npm install --legacy-peer-deps 를 실행하면 위 의존성 문제를 해결할 수 있다.


반응형

댓글