Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

420
Visualizações
Unable to install or update packages for React project

I've been working on my react project and am unable to update or install new packages without my computer making a ton of noise. I know it has something to do with the versions of react-dom and react-router-dom but I am not sure the best way to fix it. I just don't want to screw anything up further. Any help or guidance is appreciated!

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: my-app@0.1.0
npm WARN Found: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"*" from @testing-library/react@11.2.7
npm WARN   node_modules/@testing-library/react
npm WARN     @testing-library/react@"^11.2.2" from the root project
npm WARN   5 more (mini-create-react-context, react-dom, react-router, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"17.0.2" from react-dom@17.0.2
npm WARN node_modules/react-dom
npm WARN   peer react-dom@"*" from @testing-library/react@11.2.7
npm WARN   node_modules/@testing-library/react
npm WARN   1 more (the root project)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: my-app@0.1.0
npm WARN Found: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"*" from @testing-library/react@11.2.7
npm WARN   node_modules/@testing-library/react
npm WARN     @testing-library/react@"^11.2.2" from the root project
npm WARN   5 more (mini-create-react-context, react-dom, react-router, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@">=15" from react-router-dom@5.3.0
npm WARN node_modules/react-router-dom
npm WARN   react-router-dom@"^5.2.0" from the root project

These errors popped up after deleting node_modules and package-lock.json.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: my-app@0.1.0
npm ERR! Found: react@undefined
npm ERR! node_modules/react
npm ERR!   react@"^17.1.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@">=15" from react-router-dom@5.3.0
npm ERR! node_modules/react-router-dom
npm ERR!   react-router-dom@"^5.2.0" 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 /Users/cherie/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

To update all packages to a new major version, install the npm-check-updates package globally:

npm install -g npm-check-updates

then run it:

ncu -u

this will upgrade all the version hints in the package.json file, to dependencies and devDependencies, so npm can install the new major version.

then run this :

npm update

over 4 years ago · Santiago Trujillo Relatório

0

The project has been setup using an older version of NodeJS and NPM, the package manager, so it was more lax about dependencies than the current version. When working with older projects, you can use a CLI flag:

npm install --legacy-peer-deps

Just like the error actually tells you. If that is not enough, and the project is just bad as far as dependencies go, you can also use the other flag it's proposing:

npm install --force

Both of those flags relax the dependency resolution checks to work more like older version of the package manager.

This way, you can at least install the project and then you can spent some time on maintenance to fix the issues with mismatched dependency versions and ranges.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda