无法安装 react-to-pdf。

huangapple go评论56阅读模式
英文:

can not install the react-to-pdf

问题

当我尝试使用 npm install react-to-pdf 安装 react-to-pdf 包时,出现了以下错误:

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\_logs23-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\_logs23-07-10T14_01_46_021Z-debug-0.log
PS F:\PaperClip\my-Portfolio-app>
英文:

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\_logs23-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\_logs23-07-10T14_01_46_021Z-debug-0.log
PS F:\PaperClip\my-Portfolio-app> 

答案1

得分: 1

React 版本你正在使用的是 18.2.0,不受 react-to-pdf 支持,请尝试运行以下命令解决冲突:
npm i react-to-pdf --legacy-peer-deps

英文:

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

huangapple
  • 本文由 发表于 2023年7月10日 22:06:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/76654568.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定