我正在尝试npm install
,但出现以下错误。我尝试过使用--force
和--legacy-peer-deps
参数,但它们不起的作用
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-checkmark@1.4.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! peer react@">=16.8.0" from @emotion/react@11.10.4
npm ERR! node_modules/@emotion/react
npm ERR! @emotion/react@"^11.10.4" from the root project
npm ERR! peer @emotion/react@"^11.0.0-rc.0" from @emotion/styled@11.10.4
npm ERR! node_modules/@emotion/styled
npm ERR! @emotion/styled@"^11.10.4" 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! 46 more (@emotion/styled, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.6" from react-checkmark@1.4.0
npm ERR! node_modules/react-checkmark
npm ERR! react-checkmark@"^1.4.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react@16.14.0
npm ERR! node_modules/react
npm ERR! peer react@"^16.8.6" from react-checkmark@1.4.0
npm ERR! node_modules/react-checkmark
npm ERR! react-checkmark@"^1.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 C:UsersHRICK SARKARAppDataLocalnpm-cacheeresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersHRICK SARKARAppDataLocalnpm-cache_logs2022-09-19T15_51_36_949Z-debug-0.log
您拥有的react-checkmark
版本具有react 16.14.0的对等依赖关系,您的项目为react 17.0.2。降低您的react版本,直到复选标记库与react 17兼容,应该可以解决您的问题。