Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

1.2K
Vistas
How do you properly resolve NPM dependencies in projects that require conflicting versions?

I'm trying to build the playground app for react-native-navigation using instructions here. A simple npm install fails because the peer dependencies have react: "*" and react-native: "*", so today (Jan 2021) NPM tries to install react@17.0.1, but also tries to install react-native@0.63.4, which requires react@16.13.1. I get the following error:

npm ERR! While resolving: react-native-navigation@7.7.0
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   peer react@"*" from the root project
...
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"16.13.1" from react-native@0.63.4
npm ERR! node_modules/react-native
npm ERR!   peer react-native@"*" from the root project
npm ERR!   peer react-native@">=0.59" from @react-native-community/datetimepicker@2.6.2
npm ERR!   node_modules/@react-native-community/datetimepicker
npm ERR!

Then I tried to resolve this by installing react@16.13.1 in my root project, hoping that NPM would detect and use that version as a peer dependency, but then it turns out @react-native-community/datetimepicker@2.6.2 depends on react-native-windows@^0.6.20, which depends on react@16.11.0, giving me this error instead:

npm ERR! Found: react@16.13.1
npm ERR! node_modules/react
npm ERR!   dev react@"16.13.1" from the root project
...
npm ERR! Could not resolve dependency:
npm ERR! peer react@"16.11.0" from react-native-windows@0.62.20
npm ERR! node_modules/@react-native-community/datetimepicker/node_modules/react-native-windows
npm ERR!   optional react-native-windows@"^0.62.0-0" from @react-native-community/datetimepicker@2.6.2
npm ERR!   node_modules/@react-native-community/datetimepicker
npm ERR!     dev @react-native-community/datetimepicker@"^2.5.0" from the root project
npm ERR!     1 more (react-native-ui-lib)
npm ERR!

How do I get to the bottom of this? I was expecting everything to just work with npm install. What is the proper way to install a project, or is it common to have to constantly debug dependency conflicts prior to starting a project?

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

As it turns out, I was using node 15.0.x which is apparently too new. Downgrading to 14.15.1 worked.

over 4 years ago · Santiago Trujillo Denunciar

0

I too was using node 15.0.x. Downgrading to 14.x.x worked.

over 4 years ago · Santiago Trujillo Denunciar

0

Try doing npm install --legacy-peer-deps

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda