我在我的反应计划中使用“阿波罗”,我不断地收到这个错误。
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @apollo/react-common@3.1.4
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR! react@"^17.0.2" from the root project
npm ERR! peerOptional react@"^16.8.0 || ^17.0.0 || ^18.0.0" from @apollo/client@3.6.8
npm ERR! node_modules/@apollo/client
npm ERR! @apollo/client@"^3.6.8" from the root project
npm ERR! @apollo/client@"latest" from @apollo/react-components@4.0.0
npm ERR! node_modules/@apollo/react-components
npm ERR! @apollo/react-components@"^4.0.0" from the root project
npm ERR! 1 more (@apollo/react-hooks)
npm ERR! 18 more (@emotion/react, @material-ui/core, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from @apollo/react-common@3.1.4
npm ERR! node_modules/@apollo/react-common
npm ERR! @apollo/react-common@"^3.1.4" from the root project
npm ERR! @apollo/react-common@"^3.1.4" from @apollo/react-ssr@3.1.5
npm ERR! node_modules/@apollo/react-ssr
npm ERR! @apollo/react-ssr@"^3.1.5" from react-apollo@3.1.5
npm ERR! node_modules/react-apollo
npm ERR! react-apollo@"^3.1.5" from the root project
npm ERR! 5 more (@apollo/react-hooks, react-apollo, ...)
npm ERR!
npm ERR! Conflicting peer dependency: react@16.14.0
npm ERR! node_modules/react
npm ERR! peer react@"^16.8.0" from @apollo/react-common@3.1.4
npm ERR! node_modules/@apollo/react-common
npm ERR! @apollo/react-common@"^3.1.4" from the root project
npm ERR! @apollo/react-common@"^3.1.4" from @apollo/react-ssr@3.1.5
npm ERR! node_modules/@apollo/react-ssr
npm ERR! @apollo/react-ssr@"^3.1.5" from react-apollo@3.1.5
npm ERR! node_modules/react-apollo
npm ERR! react-apollo@"^3.1.5" from the root project
npm ERR! 5 more (@apollo/react-hooks, react-apollo, ...)
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 /home/runner/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2022-06-17T09_09_33_753Z-debug-0.log
make: *** [Makefile:35: node_modules] Error 1
Error: Process completed with exit code 2.我试图使用--legacy-peer-deps,但没有成功。JFY,我使用这些依赖项
发布于 2022-10-23 10:25:49
您应该降低react@"^16.8.0"在package.json中的反应版本,因为@apollo/react-common@3.1.4报告与17不兼容。您必须等到它们升级或删除包。
https://stackoverflow.com/questions/72657239
复制相似问题