安装时反应弹簧错误 [英] React spring Errors while installing

查看:229
本文介绍了安装时反应弹簧错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个问题,如果我想将 react-spring 安装到我的 react 项目中,它只会弹出一堆依赖项错误和警告,我不知道该怎么办.我试图检查 react-spring 的文档,但找不到任何东西.我在stackoverflow上检查了几页,但仍然没有找到任何有用的东西.有人可以帮忙吗?

Hi I have this problem where if I want to install react-spring into my react project It just pops up bunch of dependencies errors and warnings and I don't know what to do with it. I tried to check documentation of react-spring but I couldn't find anything. I checked few pages here on stackoverflow and I still did not find anything useful. Can somebody help?

npm WARN ERESOLVE overriding peer dependency
npm WARN Found: react@17.0.2
npm WARN node_modules/react-spring/node_modules/react
npm WARN   peer react@">=16.8" from @react-spring/konva@9.0.0
npm WARN   node_modules/react-spring/node_modules/@react-spring/konva
npm WARN     @react-spring/konva@"^9.0.0" from react-spring@9.0.0
npm WARN     node_modules/react-spring
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"16.8.x" from react-konva@16.8.6
npm WARN node_modules/react-spring/node_modules/react-konva
npm WARN   peer react-konva@">=16.8" from @react-spring/konva@9.0.0
npm WARN   node_modules/react-spring/node_modules/@react-spring/konva
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: react@17.0.2
npm WARN node_modules/react-spring/node_modules/react
npm WARN   peer react@">=16.8" from @react-spring/konva@9.0.0
npm WARN   node_modules/react-spring/node_modules/@react-spring/konva
npm WARN     @react-spring/konva@"^9.0.0" from react-spring@9.0.0
npm WARN     node_modules/react-spring
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.0.0" from react-dom@16.8.6
npm WARN node_modules/react-spring/node_modules/react-dom
npm WARN   peer react-dom@"16.8.x" from react-konva@16.8.6
npm WARN   node_modules/react-spring/node_modules/react-konva
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: konva@7.2.5
npm WARN node_modules/konva
npm WARN   peer konva@">=2.6" from @react-spring/konva@9.0.0
npm WARN   node_modules/react-spring/node_modules/@react-spring/konva
npm WARN     @react-spring/konva@"^9.0.0" from react-spring@9.0.0
npm WARN     node_modules/react-spring
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer konva@"^3.2.3" from react-konva@16.8.6
npm WARN node_modules/react-spring/node_modules/react-konva
npm WARN   peer react-konva@">=16.8" from @react-spring/konva@9.0.0
npm WARN   node_modules/react-spring/node_modules/@react-spring/konva
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-spring@9.0.0
npm WARN Found: react-dom@17.0.2
npm WARN node_modules/react-dom
npm WARN   peerOptional react-dom@">=17.0" from @react-three/fiber@6.0.1
npm WARN   node_modules/@react-three/fiber
npm WARN     peer @react-three/fiber@">=6.0" from @react-spring/three@9.0.0
npm WARN     node_modules/@react-spring/three
npm WARN
npm WARN Could not resolve dependency:
npm WARN peerOptional react-dom@">=17.0" from @react-three/fiber@6.0.1
npm WARN node_modules/@react-three/fiber
npm WARN   peer @react-three/fiber@">=6.0" from @react-spring/three@9.0.0
npm WARN   node_modules/@react-spring/three
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   peer react@"*" from @testing-library/react@11.2.5
npm ERR!   node_modules/@testing-library/react
npm ERR!     @testing-library/react@"^11.2.5" from the root project
npm ERR!   peer react@"17.0.1" from react-dom@17.0.1
npm ERR!   node_modules/react-dom
npm ERR!     peer react-dom@"*" from @testing-library/react@11.2.5
npm ERR!     node_modules/@testing-library/react
npm ERR!       @testing-library/react@"^11.2.5" from the root project
npm ERR!     peer react-dom@">=16.0.0" from react-visibility-sensor@5.1.1
npm ERR!     node_modules/react-visibility-sensor
npm ERR!       react-visibility-sensor@"^5.1.1" from the root project
npm ERR!     1 more (the root project)
npm ERR!   4 more (react-scripts, react-visibility-sensor, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.2" from react-reconciler@0.26.2
npm ERR! node_modules/@react-three/fiber/node_modules/react-reconciler
npm ERR!   react-reconciler@"^0.26.2" from @react-three/fiber@6.0.1
npm ERR!   node_modules/@react-three/fiber
npm ERR!     peer @react-three/fiber@">=6.0" from @react-spring/three@9.0.0
npm ERR!     node_modules/@react-spring/three
npm ERR!       @react-spring/three@"^9.0.0" from react-spring@9.0.0
npm ERR!       node_modules/react-spring
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:\...\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:

推荐答案

遇到同样的问题,this 建议修复了安装错误.尽管如此,仍然没有尝试使用它.基本上,我们应该添加

Had the same problem, this suggestion fixed the installation error. Still didn't try to work with it though. Basically, we should add

"peerDependencies": {
  "react-spring": "^8.x"
}

到 package.json 文件

to the package.json file

这篇关于安装时反应弹簧错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆