Solvedreact native router flux ERROR: UNMET PEER DEPENDENCY react@15.5.4

Environment:
"react": "16.0.0-alpha.6",
"react-native": "0.43.4"

I have installed the latest react-native project and tried to install react-native-router-flux, but end up with the error message "UNMET PEER DEPENDENCY react@15.5.4". Is there any solution to use the react-native-router-flux package with the latest react-native?

C:\workspace\SampleProject>npm i --save react-native-router-flux
SampleProject@0.0.1 C:\MyDrive\Project\workspace\SampleProject
-- react-native-router-flux@3.38.1 +-- lodash.isequal@4.5.0 +-- UNMET PEER DEPENDENCY react@15.5.4 +-- react-addons-pure-render-mixin@15.5.2 +-- react-dom@15.5.4 | -- prop-types@15.5.8
+-- react-native@0.41.2
| +-- glob@5.0.15
| +-- jest-haste-map@18.0.0
| | -- multimatch@2.1.0 | | -- array-union@1.0.2
| +-- mime-types@2.1.11
| | -- mime-db@1.23.0 | -- regenerator-runtime@0.9.6
+-- react-native-experimental-navigation@0.26.12
| -- clamp@1.0.1 +-- react-native-tabs@1.0.9 -- react-static-container@1.0.1

npm WARN react-native@0.41.2 requires a peer of react@~15.4.0 but none was installed.
npm WARN react-static-container@1.0.1 requires a peer of react@^0.13.0 || ^0.14.0 || ^15.0.0 but none was installed.
npm WARN react-dom@15.5.4 requires a peer of react@^15.5.4 but none was installed.

37 Answers

✔️Accepted Answer

I fixed this by removing the little ^ symbol in my package.json file in front of the version number of react-native-router-flux. Removing that symbol forces npm install to install the version indicated instead of the newest version.

Other Answers:

Even after installing react-native-router-flux@3.38.0 I was getting a dependency issue with react-static-container. To solve this I followed this #1710 . Go to react-native-router-flux/src/TabbedView.js and replace the third line of this file with:
const StaticContainer = require('react-native/Libraries/Components/StaticContainer.react'); You can check this file in the path location inside react-native module. Doing this you will remove the react-native-router-flux dependency with react-static-container. Now remove the react-static-container folder from your modules (if it doesn't have any other dependency with other modules). This worked for me.

I fixed this thanks to #1803 and added the 3.38.0 version of react-native-router-flux

fixed it
I update npm to the latest version by sudo npm install -g npm
then recreate project by react-native init MyProject
then npm i react-native-router-flux --save successfully

Related Issues:

141
react native router flux Duplicate versions of react-native being installed
Got wrecked by this too Fixed with the rollback to 3.38.0 react-native-router-flux v3.38.1 react-nat...
49
react native router flux @providesModule naming collision error after installing react-native-router-flux
Same problem it works if you rollback to the previous version: yarn add react-native-router-flux@3.3...
32
react native router flux Help With Drawer Menu
Hi I implemented the Drawer from router-flux v4.0.0-beta.14 like this: (I couldnt find any info on h...
31
react native router flux Bundling error
Running packager like that resolves problem for me react-native start --reset-cache --verbose Verbos...
28
react native router flux Animations for transition on Android
To anyone who stumbles on to this thread - to get the old direction= behaviour back you can just add...
26
react native router flux Ability to provide the left/right navbar buttons from the rendered component
@jrwm thanks it works The current set up of the buttons is not ideal They have to be declared and ho...
25
react native router flux Back navigation won't work on Android
I solved this way: <Router backAndroidHandler={this.onBackPress}> and: I've noticed that on Android:...
23
react native router flux Fatal Exception: com.facebook.react.common.JavascriptException: TypeError: undefined is not an object (evaluating 'r.default')
run this package.json snippet in postinstall or manually before release: For older react-navigation ...
22
react native router flux Double-tapping fires Actions twice
This is a workaround I use for the moment: For every button that triggers a navigation action ...
16
react native router flux Problem about pop and refresh
Hello guys I have the same problem with tab scene too : componentWillReceiveProps is not triggered u...
16
react native router flux onEnter/onExit hooks inside scenes components
@aksonov Can you provide a sample code using onEnter inside a component? Thanks ...
14
react native router flux Forbid swiping back
@mvaivre to disable swiping back passing panHandlers={null} worked for me e.g: <Scene key=modal comp...
13
react native router flux ERROR: UNMET PEER DEPENDENCY react@15.5.4
I fixed this by removing the little ^ symbol in my package.json file in front of the version number ...
5
react native router flux Actions.[SCENE_NAME] is not working.
with react-native-router-flux: ^3.30.2 if i set type to my scenes Actions dont work And in Drawer if...