react-desktop icon indicating copy to clipboard operation
react-desktop copied to clipboard

Can't use along with electron-react-boilerplate?

Open dzpt opened this issue 3 years ago • 3 comments
trafficstars

I've tried to install along with electron-react-boilerplate then got this error

npm install react-desktop --save


npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
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@"^15.0 || ^16.0" from [email protected]
npm ERR! node_modules/react-desktop
npm ERR!   react-desktop@"*" 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.

dzpt avatar Aug 03 '22 19:08 dzpt

The package.json of the two projects don't have the same required react version. Just change it to the same version. It will not be officially supported by one of the two project, but you do not have a choice. I am assuming your are new to nodejs, because this problem appears very often.

axoroll7 avatar Mar 15 '23 21:03 axoroll7

@dzpt You can force npm to ignore peer dependency conflicts and install react-desktop anyway npm install react-desktop --save --legacy-peer-deps. However, be cautious with this approach as it might lead to runtime issues.

oguz-yilmaz avatar Sep 09 '23 11:09 oguz-yilmaz

You can also use yarn, it doesn't have this issue

lacymorrow avatar Oct 30 '23 15:10 lacymorrow