gabrielbull / react-desktop

React UI Components for macOS High Sierra and Windows 10
http://reactdesktop.js.org
MIT License
9.51k stars 461 forks source link

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

Open dzpt opened 2 years ago

dzpt commented 2 years ago

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: 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@"^15.0 || ^16.0" from react-desktop@0.3.9
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.
axoroll7 commented 1 year ago

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.

oguz-yilmaz commented 1 year ago

@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.

lacymorrow commented 1 year ago

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