아아아아
React 버전을 18.2.0에서 17.0.0으로 다운그레이드했는데 여전히 작동하지 않습니다
파일 package.json:
// error deploy to vercel npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @testing-library/react@13.4.0 npm ERR! Found: react@17.0.0 npm ERR! node_modules/react npm ERR! react@"^17.0.0" from the root project npm ERR! peer react@">=16.8.0" from @emotion/react@11.10.6 npm ERR! node_modules/@emotion/react npm ERR! @emotion/react@"^11.10.6" from the root project 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.10.6" from the root project npm ERR! 3 more (@mui/material, @mui/styled-engine, @mui/system) npm ERR! 3 more (@mui/material, @mui/styled-engine, @mui/system) npm ERR! 22 more (@emotion/styled, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react@"^18.0.0" from @testing-library/react@13.4.0 npm ERR! node_modules/@testing-library/react npm ERR! @testing-library/react@"^13.4.0" from the root project npm ERR! npm ERR! Conflicting peer dependency: react@18.2.0 npm ERR! node_modules/react npm ERR! peer react@"^18.0.0" from @testing-library/react@13.4.0 npm ERR! node_modules/@testing-library/react npm ERR! @testing-library/react@"^13.4.0" 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 /vercel/.npm/eresolve-report.txt for a full report. npm ERR! A complete log of this run can be found in: npm ERR! /vercel/.npm/_logs/2023-04-23T19_05_45_098Z-debug-0.log Error: Command "npm install" exited with 1`
React 버전을 다운그레이드할 필요가 없습니다. 사용 중인 버전으로 다시 설정하세요.
Vercel을 열고 이 문제가 있는 프로젝트로 이동하세요.
프로젝트 상단 메뉴에서
Settings
를 클릭하세요.构建和开发设置
로 스크롤하세요.클릭
install
命令上的Override
按钮,并附加--legacy-peer-deps
。例如。安装命令:npm install --legacy-peer-deps
.변경 사항을 저장하고 프로젝트를 다시 배포하세요.