pixijs / pixi-react

Write PIXI apps using React declarative style
https://pixijs.io/pixi-react/
MIT License
2.42k stars 180 forks source link

unable to resolve dependency tree #357

Closed linediconsine closed 1 year ago

linediconsine commented 1 year ago

Description

I see errors while try to install this library

Steps to reproduce

  1. npx create-react-app app --template typescript
  2. npm install @inlet/react-pixi --save

Additional info


npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: tree@0.1.0
npm ERR! Found: pixi.js@7.0.5
npm ERR! node_modules/pixi.js
npm ERR!   pixi.js@"^7.0.5" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer pixi.js@"^6.0.0" from @inlet/react-pixi@6.8.0
npm ERR! node_modules/@inlet/react-pixi
npm ERR!   @inlet/react-pixi@"^6.8.0" 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/linediconsine/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/linediconsine/.npm/_logs/2022-12-18T18_34_23_750Z-debug-0.log ```
caseymilne commented 1 year ago

I just found the same issue today. I'm going to guess it requires an older version of React than 18.2.0? On StackOverflow a suggested work-around for similar issues (with other packages) is to use the flag --force. I tried it and the install went ahead, but it led to a lot of audit errors and I'm not sure if it will actually work (use at own risk, it might break your project).

spassvogel commented 1 year ago

fixed in https://github.com/pixijs/pixi-react/commit/29e19690d9ba0a8e435ba0c164e8b77ca286f61e, but you have to npm i @pixi/react-pixi rather than npm install @inlet/react-pixi

baseten commented 1 year ago

Yes this was a peer-deps issue in that @inlet/react-pixi did not support React 18, please use @pixi/react-pixi to resolve (and report any issues if you find them as we're still in alpha!) 😄