Open bandtank opened 3 years ago
Ok, so, I just realized the creator of the code specified yarn install
instead of npm install
. After running the former, the project installed as expected. However, the following warnings were issued:
warning "react-native > react-native-codegen > jscodeshift@0.11.0" has unmet peer dependency "@babel/preset-env@^7.1.6".
warning " > react-native-orientation-locker@1.3.1" has incorrect peer dependency "react@16.13.1".
warning " > react-native-orientation-locker@1.3.1" has incorrect peer dependency "react-native@0.63.2".
warning " > react-native-orientation-locker@1.3.1" has unmet peer dependency "react-native-windows@^0.63.3".
Is it safe to ignore these warnings? Also, why did yarn
install the dependencies even though npm
could not?
Peer dependencies for this package are extremely strict (for no reason I think) and npm takes those rules more seriously than yarn. There is a pull request which would fix it.
The error could be ignored by `npm install -f``, but of course you have to test if the package still works with your versions (it should, because react 17 was a very light release).
for anyone else running into this, until #190 is merged, temporary workaround is to set the following npm config
Globally:
npm config set legacy-peer-deps true
Or set this in a .npmrc
for your specific project:
echo "legacy-peer-deps=true" >> /path-to-your-project/.npmrc
I am brand new to react, react-native, and mobile programming, so please be gentle. I have been searching for hours to try to understand how to resolve this issue:
I understand what it means, but I'm confused because the code I'm using was given to me by a person who demonstrated its use right in front of me. I don't understand how that's possible if I am unable to install the dependencies for the project. Regardless, I know the
react-native-orientation-locker
module wants an older version ofreact
thanpackage.json
specifies, but I don't know what to do about it.I believe my options are to remove the module, which will break the app, or replace it, which would require modifying the code and I'm not ready to do that yet. Am I missing a third option? I doubt I am, but I thought I'd check to be sure. Additionally, presuming I have to make a breaking change if i want to use version 17, is there a plan for the module to support version 17 in the near future?