npm 我的react-google-login 无法安装

问题描述 投票:0回答:1

我正在尝试在我的项目中安装包“react-google-login”以进行用户身份验证。 这是错误代码:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
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 [email protected]
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-30T16_30_08_237Z-debug-0.log

我认为react版本有一些错误

reactjs authentication react-google-login
1个回答
2
投票

我认为这可能会解决您的问题。试试这个

npm 我反应谷歌登录--legacy-peer-deps

这个有什么作用?它忽略此包的旧依赖项。 您可以在此处

了解有关遗留同行部门的更多信息
© www.soinside.com 2019 - 2024. All rights reserved.