Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct "react-native-windows: "*" peer dep #66

Closed
besdar opened this issue Sep 1, 2024 · 3 comments
Closed

Correct "react-native-windows: "*" peer dep #66

besdar opened this issue Sep 1, 2024 · 3 comments
Labels
P3 Small issue. Ready Ready for release.

Comments

@besdar
Copy link

besdar commented Sep 1, 2024

Steps to reproduce:

npx @react-native-community/cli@latest init MyProject --version 0.74.5
npm install --save @dr.pogodin/[email protected]

Result:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react-native
npm ERR!   react-native@"0.74.5" from the root project
npm ERR!   peer react-native@"*" from @dr.pogodin/[email protected]
npm ERR!   node_modules/@dr.pogodin/react-native-fs
npm ERR!     @dr.pogodin/react-native-fs@"2.27.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-native@"^0.75.1" from [email protected]
npm ERR! node_modules/react-native-windows
npm ERR!   peer react-native-windows@"*" from @dr.pogodin/[email protected]
npm ERR!   node_modules/@dr.pogodin/react-native-fs
npm ERR!     @dr.pogodin/react-native-fs@"2.27.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.

checked on clean Fedora 40 installation, nodejs 20.12.2, npm 10.5.0

@besdar besdar changed the title [v2.27.1] unable to install this package for the react-native verion 0.74.x [v2.27.1] unable to resolve dependency tree for the react-native verion 0.74.x Sep 1, 2024
@birdofpreyru
Copy link
Owner

  1. The work on this library does not generate any significant revenue for me, thus I only support the latest version of this library and React Native.
  2. The error message clearly tells the problem is that conflicting RN versions have been demanded by different dependencies of your project, in particular [email protected] requires [email protected], while your project requires RN v0.74.5. I guess, you just need to pin RN windows to 0.74.x to make it work.

@besdar
Copy link
Author

besdar commented Sep 4, 2024

@birdofpreyru thank you for your reply. Ok, I understand that you only support the latest version of the library, no problem.

About the second point: Yes, sorry for taking your time. I don't have a react-native-windows dependency in my project, and it seems that since your library's package.json has a peerDependency "react-native-windows: "*", it causes npm to download the latest available package, which is now 0.75.X, and then it conflicts with my older versions of RN. Installing your package with the --legacy-peer-deps flag solves the problem.

@birdofpreyru birdofpreyru changed the title [v2.27.1] unable to resolve dependency tree for the react-native verion 0.74.x Correct "react-native-windows: "*" peer dep Sep 4, 2024
@birdofpreyru
Copy link
Owner

Ok, I guess going forward "react-native-windows: "*" in package.json should be changed to "react-native-windows: "0.75", or whatever the matching version of RN is.

@birdofpreyru birdofpreyru reopened this Sep 4, 2024
@birdofpreyru birdofpreyru added the P3 Small issue. label Sep 4, 2024
@birdofpreyru birdofpreyru added the Ready Ready for release. label Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Small issue. Ready Ready for release.
Projects
None yet
Development

No branches or pull requests

2 participants