Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

can not install the react-to-pdf

When I try to install the react-to-pdf package with npm install react-to-pdf, I get this error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-portfolio-app@0.0.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@"^16.5.2" from react-to-pdf@0.0.14
npm ERR! node_modules/react-to-pdf
npm ERR!   react-to-pdf@"*" 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!
npm ERR! For a full report see:
npm ERR! C:\Users\ga\AppData\Local\npm-cache\_logs\2023-07-10T14_01_46_021Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: C:\Users\ga\AppData\Local\npm-cache\_logs\2023-07-10T14_01_46_021Z-debug-0.log
PS F:\PaperClip\my-Portfolio-app> 

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

The react version you re running is 18.2.0 and it’s not supported by react-to-pdf try running to fix conflict:
npm i react-to-pdf –legacy-peer-deps

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading