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: `-- react-native-maps@0.14.0 npm WARN react-native-maps@0.14.0 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.
- Tried installing
npm install react@15.4.0 --save
Got these warnings:
npm WARN react-native@0.43.3 requires a peer of react@16.0.0-alpha.6 but none was installed. npm WARN react-test-renderer@16.0.0-alpha.6 requires a peer of react@^16.0.0-alpha.6 but none was installed.
So, in order to resolve this, I tried installing react@16.0.0-alpha.6 with: npm install react@16.0.0-alpha.6
.
I got the same message again:
npm WARN react-native-maps@0.14.0 requires a peer of react@>=15.4.0 but none was installed.
- Tried updating react-native
npm update react-native
.
Still getting the same warning message.
- Tried installing the latest version of npm:
npm install npm@latest -g
.
Didn't work.
Additional Information
- react-native: 0.43.3
- react-native-cli: 2.0.1
- Platform: Android
- Development Operating System: Windows 10 OS
Here's how I was able to solve this (chronological order):
npm cache clean
npm install all module
npm install
npm i react-native-maps@0.12.5 --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 ;)