我正在尝试安装 react-tinder-card 并给我这个错误我不知道如何解决它,有什么帮助吗?
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! While resolving: tinder_clone_react@0.1.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR! react@"^17.0.2" from the root project
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from react-tinder-card@1.4.0
npm ERR! node_modules/react-tinder-card
npm ERR! react-tinder-card@"*" from the root project
答案 0 :(得分:0)
由于 react
版本不匹配,这似乎是一个错误:react-tinder-card
需要 16.8.0
,但在您的项目中您有 17.0.2
。
为了解决这个问题,你可以将你的 react 版本降级到 16
(不推荐)或者你可以 fork react-tinder-card
,更新包以接受 react@17
作为对等依赖并检查是否一切正常。
我建议您也在 react-tinder-card
上打开一个问题,并要求他们做同样的事情(升级对等依赖中的 React 版本)。