Reactjs des Abhängigkeitsbaums können nicht aufgelöst werden

Lesezeit: 6 Minuten

Ich versuche, die React-Tinder-Card in meinem aktuellen Projekt zu installieren. Also versuche ich, die React-Tinder-Card zu installieren, aber nachdem ich den Befehl verwendet habe

npm install –save reagieren-zunder-karte

Alles, was ich in meiner Konsole sehen kann, ist:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   [email protected]"^17.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer [email protected]"^16.8.0" from [email protected]
npm ERR! node_modules/react-tinder-card
npm ERR!   [email protected]"*" 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

Als ich die Datei debug.log öffnete, fand ich Folgendes:

0 ausführlich 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 mit [email protected] 2 Info mit [email protected] 3 Timing config:load:defaults Abgeschlossen in 3ms 4 Timing config:load:file:/usr/lib/node_modules/npm/npmrc Abgeschlossen in 0ms 5 Timing config :load:builtin Abgeschlossen in 1ms 6 Zeit config:load:cli Abgeschlossen in 3ms 7 Zeit config:load:env Abgeschlossen in 1ms 8 Zeit config:load:file:/home/nero/Documents/MERN/tinder-clone/.npmrc Abgeschlossen in 1ms 9 Timing config:load:project Abgeschlossen in 2ms 10 Timing config:load:file:/home/nero/.npmrc Abgeschlossen in 0ms 11 Timing config:load:user Abgeschlossen in 0ms 12 Timing config:load:file:/ usr/etc/npmrc Abgeschlossen in 0ms 13 Timing config:load:global Abgeschlossen in 0ms 14 Timing config:load:cafile Abgeschlossen in 0ms 15 Timing config:load:validate Abgeschlossen in 0ms 16 Timing config:load:setUserAgent Abgeschlossen in 0ms 17 Timing config:load:setEnvs Abgeschlossen in 1ms 18 timing config:load Abgeschlossen in 12ms 19 verbose npm-session b46c4469ef66a9f2 20 timing npm:load Abgeschlossen in 19ms 21 timing arborist:ctor Abgeschlossen in 0ms 22 Timing idealTree:init Abgeschlossen in 1413ms 23 timing idealTree:userRequests Abgeschlossen in 3ms 24 albern idealTree buildDeps 25 albern Manifest abrufen [email protected]* 26 http abrufen GET 200 188 ms (aus dem Cache) 27 Dummes Abrufmanifest [email protected]^17.0.1 28 Timing arborist:ctor Abgeschlossen in 0 ms 29 http fetch GET 304 1196 ms (aus Cache) 30 Timing idealTree Abgeschlossen in 2812 ms 31 Timing-Befehl: Installieren Abgeschlossen in 2815 ms 32 Ausführlicher Stack-Fehler: Abhängigkeitsbaum kann nicht aufgelöst werden 32 Ausführlicher Stack bei Arborist.[failPeerConflict] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1011:25) 32 ausführlicher Stack bei Arborist.[loadPeerSet] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:991:36) 32 ausführlicher Stapel bei asynchronem Arborist.[buildDepStep] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:760:11) 32 ausführlicher Stapel bei asynchronem Arborist.buildIdealTree (/usr/lib/node_modules/npm /node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:202:7) 32 ausführlicher Stack bei asynchronem Promise.all (Index 1) 32 ausführlicher Stack bei asynchronem Arborist.reify (/usr/lib/ node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:121:5) 32 ausführlicher Stack bei asynchroner Installation (/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 kann den Abhängigkeitsbaum nicht auflösen 40 error 41 error Beim Auflösen: [1mtinder-clone[[email protected][1m0.1.0[22m
41 error Found: [1mreact[[email protected][1m17.0.1[22m[2m[22m
41 error [2mnode_modules/react[22m
41 error   [1mreact[[email protected]"[1m^17.0.1[22m" from the root project
41 error
41 error Could not resolve dependency:
41 error [35mpeer[39m [1mreact[[email protected]"[1m^16.8.0[22m" from [1mreact-tinder-card[[email protected][1m1.3.1[22m[2m[22m
41 error [2mnode_modules/react-tinder-card[22m
41 error   [1mreact-tinder-card[[email protected]"[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

I don’t understand what that means. Please help me find the solution.Any sort of help would be appreciated.
Thank you in advance.

  • Hi Sunil! I have just posted an answer to a similar question here:…. The core of the problem that you’re facing is exactly the same, only the details differ. This answer should guide you in the right direction.

    – Avius

    Nov 9, 2020 at 0:53

  • Thank @Avius for this.

    – Sunil Shah

    Nov 10, 2020 at 10:52

Vaibhav Dhawale's user avatar
Vaibhav Dhawale

$ npm install --save react-tinder-card --legacy-peer-deps

  • And what exactly will do this command? Please explain it for other users.

    – SwissCodeMen

    Dec 12, 2020 at 13:00

  • I have found @Arosha ‘s answer to be more helpful, the package will install with the –legacy flag, but the module doesn’t work. It’s easier to downgrade to npm 6

    – Luke Vanzweden

    Jun 5, 2021 at 15:28

  • Well, this command worked for me. But I had a question that is it a good practice, If not then what could be the alternatives to it?

    – Meet Bhalodiya

    May 16 at 4:54

  • Recently i had this problem and my solution was to update my node version from 14 to 16

    – Gabriel Rodrigues

    Jun 4 at 17:13

Mon's user avatar

This error comes from version 7.x of npm.

Please try again with the --legacy-peer-deps option.

What this error basically says is that [email protected] in it’s peer dependencies has [email protected]"^16.8.0". So it needs that version of react to function properly. On your [email protected] application you currently have [email protected].

This problem can be solved manually by just installing version of react that [email protected] needs which is [email protected]"^16.8.0", so you need to downgrade your version to run the package.

The --legacy-peer-deps flag was introduced with v7 of npm as a way to bypass peerDependency auto-installation; it tells NPM to ignore peer deps and proceed with the installation anyway. This can cause some unwanted behavior and I would not suggest it.

Downgrade to npm v6. It should fix the issue.

npm install -g [email protected]

This happens when you are trying to clone a project which is built a long time ago, and project dependencies have moved on to newer versions.

Just run below code. Works fine for me every time. You should also see this solution with the error.

 npm install --legacy-peer-deps

Tatyana Molchanova's user avatar
Tatyana Molchanova

The react-apollo package has been deprecated, and the functionality offered by each of the above packages can now be accessed from @apollo/client directly:

@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

Larry Sankey's user avatar
Larry Sankey

I had the same error above. I installed npm v6.7. I reinstalled Netlify CMS and Gatsby:

npm install [email protected] [email protected]^4.0.0

I don’t have anything under the static folder except a favicon.ico file. No admin folder and no .yml file.

1434480cookie-checkReactjs des Abhängigkeitsbaums können nicht aufgelöst werden

This website is using cookies to improve the user-friendliness. You agree by using the website further.

Privacy policy