我正在try 在我当前的项目中安装react tinder卡.所以我try 安装react tinder卡,但在我使用命令之后

npm安装--保存react ignition 卡

在我的控制台中,我只能看到:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: tinder-clone@0.1.0
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from react-tinder-card@1.3.1
npm ERR! node_modules/react-tinder-card
npm ERR!   react-tinder-card@"*" 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 /home/nero/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/nero/.npm/_logs/2020-11-06T16_36_39_957Z-debug.log

当我打开调试时.日志(log)文件,我找到了这个:

0 verbose cli [
0 verbose cli   '/usr/bin/node',
0 verbose cli   '/usr/bin/npm',
0 verbose cli   'install',
0 verbose cli   '--save',
0 verbose cli   'react-tinder-card'
0 verbose cli ]
1 info using npm@7.0.3
2 info using node@v15.0.1
3 timing config:load:defaults Completed in 3ms
4 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 0ms
5 timing config:load:builtin Completed in 1ms
6 timing config:load:cli Completed in 3ms
7 timing config:load:env Completed in 1ms
8 timing config:load:file:/home/nero/Documents/MERN/tinder-clone/.npmrc Completed in 1ms
9 timing config:load:project Completed in 2ms
10 timing config:load:file:/home/nero/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/usr/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 12ms
19 verbose npm-session b46c4469ef66a9f2
20 timing npm:load Completed in 19ms
21 timing arborist:ctor Completed in 0ms
22 timing idealTree:init Completed in 1413ms
23 timing idealTree:userRequests Completed in 3ms
24 silly idealTree buildDeps
25 silly fetch manifest react-tinder-card@*
26 http fetch GET 200 https://registry.npmjs.org/react-tinder-card 188ms (from cache)
27 silly fetch manifest react@^17.0.1
28 timing arborist:ctor Completed in 0ms
29 http fetch GET 304 https://registry.npmjs.org/react 1196ms (from cache)
30 timing idealTree Completed in 2812ms
31 timing command:install Completed in 2815ms
32 verbose stack Error: unable to resolve dependency tree
32 verbose stack     at Arborist.[failPeerConflict] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1011:25)
32 verbose stack     at Arborist.[loadPeerSet] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:991:36)
32 verbose stack     at async Arborist.[buildDepStep] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:760:11)
32 verbose stack     at async Arborist.buildIdealTree (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:202:7)
32 verbose stack     at async Promise.all (index 1)
32 verbose stack     at async Arborist.reify (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:121:5)
32 verbose stack     at async install (/usr/lib/node_modules/npm/lib/install.js:40:5)
33 verbose cwd /home/nero/Documents/MERN/tinder-clone
34 verbose Linux 5.4.0-52-generic
35 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "--save" "react-tinder-card"
36 verbose node v15.0.1
37 verbose npm  v7.0.3
38 error code ERESOLVE
39 error ERESOLVE unable to resolve dependency tree
40 error
41 error While resolving: [1mtinder-clone[22m@[1m0.1.0[22m
41 error Found: [1mreact[22m@[1m17.0.1[22m[2m[22m
41 error [2mnode_modules/react[22m
41 error   [1mreact[22m@"[1m^17.0.1[22m" from the root project
41 error
41 error Could not resolve dependency:
41 error [35mpeer[39m [1mreact[22m@"[1m^16.8.0[22m" from [1mreact-tinder-card[22m@[1m1.3.1[22m[2m[22m
41 error [2mnode_modules/react-tinder-card[22m
41 error   [1mreact-tinder-card[22m@"[1m*[22m" from the root project
41 error
41 error Fix the upstream dependency conflict, or retry
41 error this command with --force, or --legacy-peer-deps
41 error to accept an incorrect (and potentially broken) dependency resolution.
41 error
41 error See /home/nero/.npm/eresolve-report.txt for a full report.
42 verbose exit 1

我不明白那是什么意思.请帮我找到解决办法.任何形式的帮助都将不胜感激.

推荐答案

https://www.apollographql.com/docs/react/migrating/apollo-client-3-migration/

react apollo软件包已被弃用,上述每个软件包提供的功能现在可以从@apollo/client直接访问:

@apollo/react-hooks -> now available directly from @apollo/client
@apollo/react-components -> now available from @apollo/client/react/components
@apollo/react-hoc -> now available from @apollo/client/react/hoc
@apollo/react-ssr -> now available from @apollo/client/react/ssr
@apollo/react-testing -> now available from @apollo/client/testing

Reactjs相关问答推荐

无法使用#13;或br将新行设置为文本区域'"&"<>

替换谷歌 map api默认信息窗口与自定义

通过单击具有此值的按钮将值添加到数组对象键

使用Reaction钩子窗体验证可选字段

无法将react 路由状态从路由传递给子组件

我如何在不被 destruct 的情况下将导航栏固定在顶部?

如何删除 bootstrap 手风琴上的边框

太多的重新渲染 - React 中的无限循环.如何使用React.effect并使用fetch?

React-router动态路径

对于 ref 上的可见 prop 或 open 方法来react 组件,哪种方式更好?

是否可以直接在 jsx 标签上使用 CSS 定义的 colored颜色 ?

使用jest如何覆盖对象的模拟?我正在使用`jest.mock()`来模拟对象,并希望 for each 测试用例覆盖模拟.

为什么 createSlice 中的 reducer 不能以不同的方式改变状态?

使用 MuiCssBaseline 在所有 MUI v5 标签上设置边距 0

状态链接未传递到路由页面

null 不是对象(判断RNSound.IsAndroid)

当从数组中删除数据时,UseEffect 不会重新渲染,仅在添加数据时才会重新渲染

React CSSTransition 两次创建新页面并在这两个相同的页面上运行转换

在 Reactjs 中状态发生变化时渲染一个新组件而不替换旧组件

将鼠标悬停在仅适用于该类的第一个实例的 p5.js 类上