npm安装react-google-login不起作用

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

我正在使用以下命令来安装react-google-login for React npm install 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.0.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 /Users/Baran/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Baran/.npm/_logs/2022-03-30T04_33_37_205Z-debug-0.log

reactjs npm
2个回答
45
投票

尝试使用

npm install react-google-login --force

npm install react-google-login --legacy-peer-deps

0
投票

软件包

react-google-login
已被弃用。

您可以使用

@leecheuk/react-google-login
套餐。

供参考 - https://www.npmjs.com/package/@leecheuk/react-google-login

您可以使用

@react-oauth/google
套餐。

供参考 - https://medium.com/@manwarerutuj/react-google-login-deprecated-dont-worry-react-oauth-google-will-fix-it-1b2141252952

© www.soinside.com 2019 - 2024. All rights reserved.