试图通过使用命令npm install react-google-login安装“react google”。它给出了以下错误:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-app@0.1.0
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR! react@"^18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16 || ^17" from react-google-login@5.2.2
npm ERR! node_modules/react-google-login
npm ERR! react-google-login@"*" 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:\Users\prajw\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\prajw\AppData\Local\npm-cache\_logs\2022-08-11T09_50_55_555Z-debug-0.log无法理解到底出了什么问题。自从react升级到18版以来,我们以前的使用方式发生了很多变化。
发布于 2022-08-11 10:16:46
不知道为什么但不知怎么起作用了。
跑
npm config set legacy-peer-deps truehttps://stackoverflow.com/questions/73318954
复制相似问题