nygardk / react-share

Social media share buttons and share counts for React
MIT License
2.6k stars 430 forks source link

react-share is not working for react 18.2.0 #465

Open abhishekprajapati1 opened 1 year ago

abhishekprajapati1 commented 1 year ago

I am installing react-share for my project but it is throwing following issue.


npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree        
npm ERR!
npm ERR! While resolving: client@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.3.0 || ^17" from react-share@4.4.0
npm ERR! node_modules/react-share
npm ERR!   react-share@"*" 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\ARS\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\ARS\AppData\Local\npm-cache\_logs\2022-09-30T09_49_06_524Z-debug-0.log```
totti-rdz commented 1 year ago

There is already a PR for that, but apparently no one to merge it

m-Jawa-d commented 11 months ago

try installing it by adding --legacy-peer-deps at end of install comman like npm i react-share --legacy-peer-deps

MelonBreadVR commented 9 months ago

--legacy-peer-deps is sweeping the problem under the carpet 😅