Problem
I'm trying to install react-native-maps by Airbnb in my project. Installation instructions: airbnb/react-native-maps/installation
When I run the following command in cmd: npm install react-native-maps --save
This is what I get: `-- [email protected] npm WARN [email protected] requires a peer of react@>=15.4.0 but none was installed.
Ignoring this if I proceed with further installation, and run the following command: react-native link react-native-maps
This is what I get: Scanning 561 folders for symlinks in C:\RNProjects\Mapp\node_modules (39ms) rnpm-install info Linking react-native-maps ios dependency rnpm-install info iOS module react-native-maps has been successfully linked
^As we can see, only iOS related maps modules get installed. On checking the project directory, I was able to validate that no android related module was installed.
Troubleshooting
Here's the list of thing I tried to resolve the issue, but none of them worked.
npm install [email protected] --save
Got these warnings:
npm WARN [email protected] requires a peer of [email protected] but none was installed. npm WARN [email protected] requires a peer of react@^16.0.0-alpha.6 but none was installed.
So, in order to resolve this, I tried installing [email protected] with: npm install [email protected]
.
I got the same message again:
npm WARN [email protected] requires a peer of react@>=15.4.0 but none was installed.
npm update react-native
.Still getting the same warning message.
npm install npm@latest -g
.Didn't work.
Additional Information
Here's how I was able to solve this (chronological order):
npm cache clean
npm install all module
npm install
npm i [email protected] --S
react-native link react-native-maps
Once I do this, it's successfully able to link the android and ios react-native-modules to the project.
Note: Before running the react-native run-android
command,
Run: cd android && gradlew clean && cd .. && react-native run-android
.
This will clean the gradle before running and help in avoiding any errors.
You can try:
modify package.json
"react": "~15.4.1","react-native": "0.42.3","react-test-renderer": "~15.4.1",
npm install all module;
done ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With