“ERESOLVE no pudo resolver el árbol de dependencias” al instalar npm react-facebook-login

5 minutos de lectura

avatar de usuario de andres
andrés

tratando de instalar npm react-facebook-login en mi aplicación de reacción, pero sigo recibiendo errores de dependencia? Eso suena aterrador y no quiero forzar la instalación de algo que pueda romperse en el futuro. Soy nuevo en javascript, ¿cuáles son algunas de las formas en que debo proceder?

Intenté borrar mi caché npm y eliminar módulos de nodo e instalarlos nuevamente, sin embargo, sigo recibiendo este error.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: buckets@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.0.0" from react-facebook-login@4.1.1
npm ERR! node_modules/react-facebook-login
npm ERR!   react-facebook-login@"*" 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/user/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2021-01-03T12_23_40_000Z-debug.log

debug log:

0 CLI detallado [ '/usr/bin/node', '/usr/bin/npm', 'install', 'react-facebook-login' ]
1 información usando npm@7.0.15 2 información usando node@v15.4.0 3 sincronización config:load:defaults Completado en 4ms 4 sincronización config:load:file:/usr/lib/node_modules/npm/npmrc Completado en 12ms 5 sincronización config :load:builtin Completado en 12ms 6 tiempos config:load:cli Completado en 1ms 7 tiempos config:load:env Completado en 1ms 8 tiempos config:load:file:/home/user/app/frontend/buckets/.npmrc Completado en 0ms 9 sincronización config:load:project Completado en 1ms 10 sincronización config:load:file:/home/user/.npmrc Completada en 0ms 11 sincronización config:load:user Completada en 0ms 12 sincronización config:load:file:/usr/ etc/npmrc Completado en 0ms 13 sincronización config:load:global Completado en 0ms 14 sincronización config:load:cafile Completado en 0ms 15 sincronización config:load:validate Completado en 0ms 16 sincronización config:load:setUserAgent Completado en 1ms 17 sincronización config: load:setEnvs Completado en 1ms 18 timing config:load Completado en 21ms 19 verbose npm-session a80715ea0624d48b 20 timing npm:load Completado en 30ms 21 timing arborist:ctor Completado en 1ms 22 timing idealTree:init Completado en 1531ms 23 timing idealTree:userRequests Completed en 4ms 24 tonto idealTree buildDeps 25 tonto manifiesto de búsqueda reaccionar-facebook-login@* 26 http buscar GET 200 https://registry.npmjs.org/react-facebook-login 2249ms 27 tonto manifiesto de búsqueda reaccionar@^17.0.1 28 http buscar GET 200 https://registry.npmjs.org/react 142ms 29 timing idealTree Completado en 3940ms 30 timing command:install Completado en 3944ms 31 pila detallada Error: no se pudo resolver el árbol de dependencia 31 pila detallada en Arborist.[failPeerConflict] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1045:25) 31 pila detallada en Arborist.[loadPeerSet] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1025:36) 31 pila detallada en async Arborist.[buildDepStep] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:781:11) 31 pila detallada en asíncrono Arborist.buildIdealTree (/usr/lib/node_modules/npm /node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:209:7) 31 pila detallada en async Promise.all (índice 1) 31 pila detallada en async Arborist.reify (/usr/lib/ node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:122:5) 31 pila detallada en instalación asíncrona (/usr/lib/node_modules/npm/lib/install.js:39:3) 32 verbose cwd /home/user/app/frontend/buckets 33 verbose Linux 5.4.0-58-generic 34 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "react-facebook-login " 35 verbose node v15.4.0 36 verbose npm v7.0.15 37 código de error ERESOLVE 38 error ERESOLVE no se pudo resolver el árbol de dependencia 39 error 40 error Al resolver: [1mbuckets[22m@[1m0.1.0[22m
40 error Found: [1mreact[22m@[1m17.0.1[22m[2m[22m
40 error [2mnode_modules/react[22m
40 error   [1mreact[22m@"[1m^17.0.1[22m" from the root project
40 error
40 error Could not resolve dependency:
40 error [35mpeer[39m [1mreact[22m@"[1m^16.0.0[22m" from [1mreact-facebook-login[22m@[1m4.1.1[22m[2m[22m
40 error [2mnode_modules/react-facebook-login[22m
40 error   [1mreact-facebook-login[22m@"[1m*[22m" from the root project
40 error
40 error Fix the upstream dependency conflict, or retry
40 error this command with --force, or --legacy-peer-deps
40 error to accept an incorrect (and potentially broken) dependency resolution.
40 error
40 error See /home/user/.npm/eresolve-report.txt for a full report.
41 verbose exit 1

How can I overcome this without causing any future problems? Thank you for the help.

imelgrat's user avatar
imelgrat

This error comes from version 7.x of npm. Please try again adding the --legacy-peer-deps option, as follows:

npm install react-facebook-login --legacy-peer-deps

  • adding –legacy-peer-deps at then end of command worked for me.

    – RohitAneja

    Jun 29, 2021 at 7:41

  • Thank You, This Worked for me. I got error “ERESOLVE” when installing npm i simplebar-react package. So installed this way – npm i simplebar-react –legacy-peer-deps

    – aish

    Sep 9, 2021 at 6:30


  • happening with Node 18.x too. Thanks!

    – steve

    May 24, 2022 at 18:33

  • npm version 8.18.0 still have this error

    – Cris69

    Aug 29, 2022 at 15:56

Since npm install seems broked i tried:

yarn install

And it works!

Thanks

I face this challenge too, and I was trying to run my react.js application.

I have solved it by running: npm install –legacy-peer-deps

After It started as normal

Use this at the end –force, or –legacy-peer-deps

Eg:-

npm install --force

or

npm install --legacy-peer-deps

user9869932's user avatar
user9869932

I started getting the error (below) after upgrading npm from version 6 to 7.

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency
tree

npm ERR! Fix the upstream dependency conflict, or retry this command with –force, or –legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.

In my case, using either --legacy-peer-deps or --force resulted in a useless bundle.

So I tried deleting the node_modules, package-lock.json, and bundle using yarn install. This generated a yarn.lock file and created a new package-lock.json that seemed to work fine in subsequent npm runs.

p.s. This is a temporary workaround until npm 7 works fine. After that, I will delete yarn.lock, package-lock.json and node_modules, and re-bundle using npm.

rm -rf node_modules
rm package-lock.json 
yarn install 
# generates a yarn.lock file and a new package-lock.json

# continue with npm 
npm start

Suraj Rao's user avatar
Suraj Rao

on the command, you are running just add on this --legacy-peer-deps

for me, the command was

npm install @reduxjs/toolkit react-redux

then I added

npm install @reduxjs/toolkit react-redux --legacy-peer-deps

and then boom it works

Judefabi's user avatar
Judefabi

Try running

npm update

especially if the error is a result of a firebase package that may be having a version that is outdated thus conflicting with its peers. Solved my issue as suggested by @snehal

¿Ha sido útil esta solución?