doczjs / docz

✍ It has never been so easy to document your things!
https://docz.site
MIT License
23.55k stars 1.46k forks source link

Support react 17 #1662

Closed Bajdzis closed 2 years ago

Bajdzis commented 2 years ago

Currently, if we install the docz, we will get an error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: test@1.0.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from docz@2.3.1
npm ERR! node_modules/docz
npm ERR!   docz@"*" 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.
designbyadrian commented 2 years ago

For those who encounter the error and don't know how to proceed, the temp fix is to bypass the peer installation effort:

npm install docz --save --legacy-peer-deps

This tells the installer to ignore trying to install an older version of react and react-dom on top of the recent version your project has.

But it's likely you're running a later version of Node as well, so this issue will probably be the next thing you'd have to look at: "ERR_REQUIRE_ESM error on start" https://github.com/doczjs/docz/issues/1674

prma85 commented 2 years ago

Created a PR to fix it. Let wait for the mainteners https://github.com/doczjs/docz/pull/1692

renatobenks commented 2 years ago

fixed by #1692