Failed to build DependencyGraph and Failed to build DependencyGraph

时间:2017-04-24 17:20:02

标签: reactjs react-native react-native-router-flux

Version

"react": "16.0.0-alpha.6",
"react-native": "0.43.4",
"react-native-router-flux": "^3.38.1"

Everything worked perfect but after Install react-native-router-flux all are die give too much error.

Failed to build DependencyGraph: @providesModule naming collision:
  Duplicate module name: react-native
  Paths: C:\Users\ashik\Desktop\react_apps\Friends\node_modules\react-native-router-flux\node_modules\react-native\
ackage.json collides with C:\Users\ashik\Desktop\react_apps\Friends\node_modules\react-native\package.json

This error is caused by a @providesModule declaration with the same name across two different files.
Error: @providesModule naming collision:
  Duplicate module name: react-native
  Paths: C:\Users\ashik\Desktop\react_apps\Friends\node_modules\react-native-router-flux\node_modules\react-native\
ackage.json collides with C:\Users\ashik\Desktop\react_apps\Friends\node_modules\react-native\package.json

I was already get too much question and answer as like this Error but, my React-native version and error not was same or I was not understand the solution. Please make some better solution or details for me. Also I am new in React-native and react Js.

1 个答案:

答案 0 :(得分:1)

The react-native-router-flux package includes its own (frozen) copy of react-native in order to be able to use a stable version of the navigation-experimental API from react-native. This sometimes causes collisions with the version of react-native being used in the project. Also, it seems the 3.38.1 release of react-native-router-flux causes some issues with recent versions of react-native. A possible solution is downgrading react-native-router-flux to the 3.38.0 version. Just change the line

 "react-native-router-flux": "^3.38.1"

to

 "react-native-router-flux": "3.38.0"

in your package.json, then delete the node_modules folder and run npm install. The older version should not have this issue.

reference issue in the project repo.