SoftwareBrothers / better-docs

Beautiful toolbox for jsdoc generated documentation - with 'typescript', `category` and `component` plugins
MIT License
861 stars 127 forks source link

peer dependency conflict with react #223

Closed vveewwee closed 2 years ago

vveewwee commented 2 years ago

Hello there, i have a dependency conflict when installing better-docs locally on a react app, which i forced to install nevertheless, and then i modifed the react peer dependency by adding " ||^18" but the error msg stil appears (makes sense). I would prefere not to downgrade to a lower react version to solve the problem. Any other ideas ? Would just running it with --legacy-peer-deps be the best solution ? Thank you ! Error msg:

Found: react@18.2.0 node_modules/react react@"^18.2.0" from the root project Could not resolve dependency: peer react@"^17.0.2" from better-docs@2.7.2 node_modules/better-docs better-docs@"^2.7.2" from the root project

package-lock.json:

"node_modules/better-docs": { ... }, "peerDependencies": { "react": "^17.0.2 || ^18", "react-dom": "^17.0.2 || ^18" }

LagoonProject commented 2 years ago

I have the same problem when running npm install --save-dev better-docs. How did you solved it?

npm ERR! While resolving: my-app@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@"^17.0.2" from better-docs@2.7.2
npm ERR! node_modules/better-docs
npm ERR!   dev better-docs@"*" from the root project
vveewwee commented 2 years ago

I didnt, i kept having errors everytime i typed npm commands even though i run it with --legacy-peers-deps, nobody answered so i just removed it and then closed the issue.. Sorry, if you want me i can reopen it!

LagoonProject commented 2 years ago

I didnt, i kept having errors everytime i typed npm commands even though i run it with --legacy-peers-deps, nobody answered so i just removed it and then closed the issue.. Sorry, if you want me i can reopen it!

thanks for your answer, I checked and it works with react v17.0.2 but not v18.0.2. I guess there's nothing to do, we'll have to wait until they update it.

vveewwee commented 2 years ago

Yes, thats what the error message says, and even if you change the package-lock.json file, as posted on my first comment, it still doesnt work ! So i guess you are right, we have to wait.. ^^