When installing the package I get the following error:
npm WARN [email protected] requires a peer of react-native@^0.51.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of create-react-class@^15.6.2 but none is installed. You must install peer dependencies yourself.
I'm running:
"react": "16.2.0",
"react-native": "0.52.2",
How do I fix?
I'm having the same issue. If I downgrade to react-native@^0.51.0, I then get the following error:
npm WARN [email protected] requires a peer of [email protected] but none was installed.
If I downgrade react from 16.2.0 to 16.0.0, I get this lovely error:
npm WARN [email protected] requires a peer of react@^16.2.0 but none was installed.
Any help with this issue would be greatly appreciated.
Don't worry! These are just WARNINGS, no Errors! Similar warnings appear on "react-native init testApp". It has something to do with required versions in package.json and we need another approach here towards RN upgrades. But nothing will break here.
@itinance I agree, they are only warnings, however the create-react-class peerDependecy is imo unnecessary, as this package is used only in tests – it should only be a devDependecy (it already is).
@no23reason please feel always free to send a PR :)
@itinance PR opened (#458) :)
@itinance , 0.51.x is very restrictive, remember the caret fixes the the left-most non-zero digits (the minor version here: 51). Better use something like this:
"devDependencies": {
"react-native": ">=0.51 <0.60"
},
@aMarCruz why 0.60 as the upper bound? React Native is numbered sequentially, I think the correct spec would be something like
"devDependencies": {
"react-native": ">=0.51 <1"
},
However, one of the reasons React Native is not yet 1.x is that there can (and often are) breaking changes between minor releases. Therefore I believe a strict peerDependency spec is a good thing here as it tells you "This has been tested on this release of React Native and it works. Any other might not work properly".
@no23reason yes. I'm pretty sure that a library that works with RN 0.51 will hardly work with RN 0.60.
If RN followed the Semver that range would be adequate, but a new version of RN always implies a "crossing of the fingers" and hope that things do not break ... ...not a lot :smirk:
BTW: until RN v0.55.3 is working ok, fortunately react-native-fs does depends on very stable APIs, this is why I think 0.60 is a reasonable limit.
Also getting peer dependency warnings, although not the same, creating a new issue for this seemed a bit too much.
warning " > [email protected]" has incorrect peer dependency "react-native@^0.59.5".
warning " > [email protected]" has unmet peer dependency "react-native-windows@^0.57.2".
package.json
"react": "16.8.6",
"react-native": "0.60.6"
@JBuijgers getting the same issue. Unable to install an app on my device
npm forces the caret selector ^ whichever package you touched with it.
I mean, it is frustrating if #481 is unintentionally reverted in 587a6f7d9a16b4c6cfaca5457e966c4bfe64d3bb.
cc @itinance
Most helpful comment
npm forces the caret selector
^whichever package you touched with it.I mean, it is frustrating if #481 is unintentionally reverted in 587a6f7d9a16b4c6cfaca5457e966c4bfe64d3bb.
cc @itinance