2017-04-24 87 views
0

版本未能建立DependencyGraph并未能建立DependencyGraph

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

一切工作完美,但安装后react-native-router-flux 所有人都死给太多的错误。

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 

我已经得到太多的问题和答案像这样的错误,但是,我的阵营原生版本和错误不会是相同的或者我不明白的解决方案。请为我制作一些更好的解决方案或细节。另外我是React-native中的新成员,并对Js做出反应。

回答

1

react-native-router-flux包中包含自己的(冻结)副本react-native,以便能够使用来自react-nativenavigation-experimental API的稳定版本。这有时会导致与项目中使用的版本react-native发生冲突。另外,看起来react-native-router-flux3.38.1版本会导致react-native最近版本的一些问题。可能的解决方案是将react-native-router-flux降级到3.38.0版本。只要改变行

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

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

package.json,然后删除node_modules文件夹并运行npm install。旧版本不应该有这个问题。

reference issue in the project repo

+0

#Pedro_Castilho非常感谢你.....真的很帮助我,节省了我太多的时间尽管我已经尝试了两个多小时。 :) 我是** React-native **中的新人,如果你给我任何关于我的课程的建议,那对我来说将会很棒。 –