itinance / itinance/react-native-fs

Peer dependency issue with react-native-windows

Open
#1,054 2 comments 4 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

I tried to run `npm install` on my project and came across this error:

> npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: myproject@0.0.1
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR! react@"17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"17.0.2" from react-native-windows@0.66.4
npm ERR! node_modules/react-native-windows
npm ERR! peer react-native-windows@"*" from react-native-fs@2.18.0
npm ERR! node_modules/react-native-fs
npm ERR! react-native-fs@"^2.18.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.

react-native info output:

> System:
OS: Windows 10 10.0.19042
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 3.90 GB / 15.81 GB
Binaries:
Node: 15.0.1 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 7.0.3 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 28, 29, 30
Build Tools: 28.0.3, 29.0.2, 30.0.2
System Images: android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
Windows SDK:
AllowAllTrustedApps: Enabled
AllowDevelopmentWithoutDevLicense: Enabled
IDEs:
Android Studio: Version 4.1.0.0 AI-201.8743.12.41.6858069
Visual Studio: Not Found
Languages:
Java: 1.8.0_262
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.3 => 0.64.3
react-native-windows: Not Found
npmGlobalPackages:
*react-native*: Not Found

Using version 2.18.0 of react-native-fs

I couldn't find any fix to this issue apart from adding `--legacy-peer-deps` option to `npm install` which is not recommended to use. While searching answers to this issue, I found this [twitter thread](https://twitter.com/satya164/status/1460929480248152068) that may help understanding the issue here.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.