React Native中的歧义解析(涉及父项目>子项目)

时间:2018-09-08 14:12:36

标签: node.js reactjs react-native npm

我有两个React-native项目,一个是父项目retoplayBase,另一个是子项目retoplaySoccer(它们使用父项目中的代码作为在不同项目之间重用代码的一种方式) ,升级到本机反应0.54 /反应16.3.0-alpha.1后,运行retoplaySoccer时出现此错误:

error: bundling failed: ambiguous resolution: module `/Volumes/Respaldo/Desarrollo/nitido/retoplayBase/RetoPlayBaseApp.js` tries to require `react-native`, but there are several files providing this module. You can delete or fix them: 

  * `/Volumes/Respaldo/Desarrollo/nitido/retoplayBase/node_modules/react-native/package.json`
  * `/Volumes/Respaldo/Desarrollo/nitido/retoplaySoccer2/node_modules/react-native/package.json`

如何解决这种歧义?每个项目都有自己的node_modules,这就是问题所在,有没有一种方法可以组织一个父项目和多个不需要多个node_modules文件夹的子项目?

0 个答案:

没有答案