question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't install with NPM, unable to resolve dependency tree

See original GitHub issue

Environment

System:                                                                                                                                                                                                                
    OS: Windows 10 10.0.22000                                                                                                                                                                                          
    CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor                                                                                                                                                                    
    Memory: 3.65 GB / 15.93 GB                                                                                                                                                                                         
  Binaries:
    Node: 16.7.0 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 7.20.3 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK:
      API Levels: 29, 30, 31
      Build Tools: 29.0.2, 30.0.2, 31.0.0
      System Images: android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
      Android NDK: Not Found
    Windows SDK: Not Found
  IDEs:
    Android Studio: Version     2020.3.0.0 AI-203.7717.56.2031.7621141
    Visual Studio: 16.10.31515.178 (Visual Studio Community 2019)
  Languages:
    Java: 1.8.0_302
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1
    react-native: 0.64.1 => 0.64.1
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Description

I’ve tried to install this module with npm install @react-native-community/slider but got an ERESOLVE message below.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: app@0.9.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!   peer react@"*" from @react-native-community/slider@4.1.9
npm ERR!   node_modules/@react-native-community/slider
npm ERR!     @react-native-community/slider@"*" from the root project
npm ERR!   1 more (react-native)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.2" from react-native-windows@0.66.1
npm ERR! node_modules/react-native-windows
npm ERR!   peer react-native-windows@"*" from @react-native-community/slider@4.1.9
npm ERR!   node_modules/@react-native-community/slider
npm ERR!     @react-native-community/slider@"*" 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.

I’ve also tried to install it with --force option but it crashes the app whenever I try to render a slider.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ekremaycommented, Oct 21, 2021

@BartoszKlonowski I was able to install it without any errors using yarn. I leave the environment information in case it may be useful.

System:
    OS: Windows 10 10.0.19042
    CPU: (8) x64 Intel(R) Core(TM) i7 CPU         870  @ 2.93GHz
    Memory: 1.14 GB / 8.96 GB
  Binaries:
    Node: 16.10.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.1.0 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK:
      API Levels: 29, 30
      Build Tools: 29.0.2, 30.0.2, 30.0.3
      System Images: android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
      Android NDK: Not Found
    Windows SDK:
      AllowAllTrustedApps: Disabled
  IDEs:
    Android Studio: Version     2020.3.0.0 AI-203.7717.56.2031.7678000
    Visual Studio: 15.9.28307.423 (Visual Studio Community 2017), 16.2.29123.88 (Visual Studio Community 2019)
  Languages:
    Java: 16.0.1 - C:\Program Files\Common Files\Oracle\Java\javapath\javac.EXE
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.65.1 => 0.65.1
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
1reaction
coneforapinecommented, Oct 18, 2021

I’ve never actually thought about updating npm. It worked when I passed --legacy-peer-deps. I’ll try to create a new project to check if a newer npm version fixes the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to resolve dependency tree error when installing npm ...
You have dependency conflict (incorrect and potentially broken dependency) as it says, so try to run the command with --force , or --legacy-peer ......
Read more >
Unable to resolve dependency tree error in Angular while ...
To fix Unable to resolve dependency tree error in Angular while installing `npm` packages follow the below steps. 1. Run `npm install --save ......
Read more >
ERESOLVE unable to resolve dependency tree when npm ...
Remove node_modules folder and package-lock. · Run npm install –force instead of npm install command · if you got the same error, try...
Read more >
"Unable to resolve dependency tree" error during NPM install ...
Delete node_module folder and the package-lock.json file. · Run npm cache verify to verify and clean up your npm. · Run npm install...
Read more >
unable to resolve dependency tree angular - You.com
You have dependency conflict (incorrect and potentially broken dependency) as it says, so try to run the command with --force , or --legacy-peer-deps...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found