IT'S DO
728x90

npm install 시  아래 처럼 나올 때.

 

# 에러 내용 :

 

$ npm install npm error code ERESOLVE npm error ERESOLVE could not resolve npm error npm error While resolving: react-virtualized@9.22.3 npm error Found: react@17.0.2 npm error node_modules/react npm error react@"^17.0.2" from the root project npm error peer react@"*" from @testing-library/react@12.1.2 npm error node_modules/@testing-library/react npm error @testing-library/react@"^12.1.2" from the root project npm error 3 more (react-dom, react-icons, react-scripts) npm error npm error Could not resolve dependency: npm error peer react@"^15.3.0 || ^16.0.0-alpha" from react-virtualized@9.22.3 npm error node_modules/react-virtualized npm error react-virtualized@"^9.22.3" from the root project npm error npm error Conflicting peer dependency: react@16.14.0 npm error node_modules/react npm error peer react@"^15.3.0 || ^16.0.0-alpha" from react-virtualized@9.22.3 npm error node_modules/react-virtualized npm error react-virtualized@"^9.22.3" from the root project npm error npm error Fix the upstream dependency conflict, or retry npm error this command with --force or --legacy-peer-deps npm error to accept an incorrect (and potentially broken) dependency resolution. npm error npm error npm error For a full report see: npm error C:\Users\User\_logs\2024-10-30T06_55_43_485Z-eresolve-report.txt npm error A complete log of this run can be found in: C:\Users\User\_logs\2024-10-30T06_55_43_485Z-debug-0.log

 

#원인 :

ERESOLVE 오류는 주로 패키지의 의존성 충돌로 인해 발생함.

 

# 해결 : 

# 터미널에 react version 확인.

npm view react version

 

해당하는 react 폴더 안에 package.json 파일 안에서

현재 사용하는 버전 맞춰주기. 

아래 버전이 다르면 지워서 버전 맞춰주기.

"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.27.0",
"react-scripts": "5.0.1",
"react-icons": "^4.3.1",
"react-virtualized": "^9.22.3",
profile

IT'S DO

@멋진놈

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!