reactjs 无法安装React App依赖项的最新版本

6ss1mwsb  于 2023-03-08  发布在  React
关注(0)|答案(2)|浏览(165)

我从GitHub克隆了一个项目,并尝试使用npm install安装依赖项,但它抛出错误:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: 3dfolio@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@"^15.0.0 || ^16.0.0-beta || ^16.0.0" from react-tilt@0.1.4
npm ERR! node_modules/react-tilt
npm ERR!   react-tilt@"^0.1.4" 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 C:\Users\Gyan Prakash\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Gyan Prakash\AppData\Local\npm-cache\_logs\2023-03-06T18_09_10_160Z-debug-0.log

存在解决该错误的任何方法。

vxf3dgd4

vxf3dgd41#

//运行

npm config set legacy-peer-deps true

npm i
fgw7neuy

fgw7neuy2#

在npm命令的末尾添加--legacy-peer-deps,如下所示👇

npm i --legacy-peer-deps

npm i --force

相关问题