react-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.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 30
  • Comments: 36 (2 by maintainers)

Commits related to this issue

Most upvoted comments

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.

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 https://github.com/aksonov/react-native-router-flux/issues/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.

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

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

Reinstalling yarn did the trick.

npm install -g yarn

I fixed this by updating react and npm.

same problem.

I use yarn install , and @wvicioso solution + react-native 0.43.2. work perfectly.