Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.1K
Views
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 answers
Answer question

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 Report

0

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

over 4 years ago · Santiago Trujillo Report

0

Try doing npm install --legacy-peer-deps

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!