Reputation: 53
Trying to install "react-google-login" by using the command
npm install react-google-login
.
It gives the following error :
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-11T09_50_55_555Z-debug-0.log
Not able to understand what is going wrong. Since the react has upgraded to version 18, there has been a lot of changes on how we used things previously.
Upvotes: 0
Views: 528
Reputation: 1
Unfortunately as the error message states, React 18 is not supported by "react-google-login".
While we wait for this, hopefully this helps.
npm uninstall react-google-login
npm install @leecheuk/react-google-login
@leecheuk/react-google-login is a fork of anthonyjgrove/react-google-login and has plugin_name support & updated peerDependency for React 18.
Upvotes: 0
Reputation: 811
Don't know why, but somehow it works.
run
npm config set legacy-peer-deps true
Upvotes: 1