Rumah > Soal Jawab > teks badan
rreeee
Saya menurunkan versi React daripada 18.2.0 kepada 17.0.0 dan ia masih tidak berfungsi
Pakej fail.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`
P粉0630399902024-02-22 13:42:11
Tidak perlu menurunkan versi React anda - tetapkannya semula kepada versi yang anda miliki.
Buka Vercel dan pergi ke projek di mana anda mengalami masalah ini.
Pada menu atas projek, klik Settings
.
Tatal ke 构建和开发设置
.
Klik install
命令上的 Override
按钮,并附加 --legacy-peer-deps
。例如。安装命令:npm install --legacy-peer-deps
.
Simpan perubahan dan gunakan semula projek.