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

428
Visualizações
Error while installing node module in ReactJs

I just cloned a React application from Git that doesn't have node_modules on it. I try to install with command npm install but unable to do it. Following error occurs when installing the npm.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: fuse-react-app@2.0.0
npm ERR! Found: date-fns@2.0.0-alpha.26
npm ERR! node_modules/date-fns
npm ERR!   date-fns@"2.0.0-alpha.26" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer date-fns@"2.0.0-alpha.21" from @date-io/date-fns@1.0.1
npm ERR! node_modules/@date-io/date-fns
npm ERR!   @date-io/date-fns@"1.0.1" 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 C:\Users\...\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\...\AppData\Local\npm-cache\_logs\2022-04-24T12_44_19_589Z-debug-0.log

I even tried with npm install --legacy-peer-deps but doesn't work. How can I fix this issue?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

TL;DR

A possible solution to this problem is setting the version of date-fns to 2.0.0-alpha.21.


Full Answer

To fix your issue, you can change the version of date-fns.

To do this, follow these steps.

  1. In package.json, edit the version of date-fns with the following:

    {
      "dependencies": {
        "date-fns": "2.0.0-alpha.21"
      }
    }
    
  2. Save the package.json file, and run the following command in the same directory as package.json.

    $ npm install
    
  3. Your dependencies should install successfully.


Conclusion

In conclusion, you need to change the version of date-fns to 2.0.0-alpha.21.

about 4 years ago · Juan Pablo Isaza 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