首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带有gatsby的React-spring -安装时出现错误

带有gatsby的React-spring -安装时出现错误
EN

Stack Overflow用户
提问于 2021-09-23 19:13:53
回答 1查看 101关注 0票数 0

我正在尝试将react-spring添加到gatsby (Gatsby 3.13.0,React 17.0.2)中。当我输入"npm I react-spring“时,会出现这样的错误:

代码语言:javascript
复制
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR!   peer react@"^16.8.0  || ^17.0.0" from @react-spring/core@9.2.4
npm ERR!   node_modules/@react-spring/core
npm ERR!     @react-spring/core@"~9.2.0" from react-spring@9.2.4
npm ERR!     node_modules/react-spring
npm ERR!       react-spring@"*" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.0.0" from react-reconciler@0.20.4
npm ERR! node_modules/react-zdog/node_modules/react-reconciler
npm ERR!   react-reconciler@"^0.20.4" from react-zdog@1.0.11
npm ERR!   node_modules/react-zdog
npm ERR!     peer react-zdog@">=1.0" from @react-spring/zdog@9.2.4
npm ERR!     node_modules/@react-spring/zdog
npm ERR!       @react-spring/zdog@"~9.2.0" from react-spring@9.2.4
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! 

我试过--force,或者--legacy peer-deps,但是没有用。React 17或Gatsby有问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-10-08 08:12:13

我会安装您正在使用的特定目标。例如,由于您使用的是gatsby,因此我假设您将使用@react-spring/web,这应该可以解决npm@7的问题。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69305772

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档