Failed to build DependencyGraph: @providesModule naming collision:

来源:9-4 搜索数据显示与onFavorite()方法的提取-2

超频散热

2018-06-24

学完9-3关机了,第二天npm start后报错:

Failed to build DependencyGraph: @providesModule naming collision:

  Duplicate module name: EventPluginUtils

  Paths: G:\desktop\demo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\stack\event\EventPluginUtils.js collides with G:\desktop\demo\node_modules\react-native\Libraries\StyleSheet\ColorPropType.js


This error is caused by a @providesModule declaration with the same name across two different files.

Error: @providesModule naming collision:

  Duplicate module name: EventPluginUtils

  Paths: G:\desktop\demo\node_modules\react-native\Libraries\Renderer\src\renderers\shared\stack\event\EventPluginUtils.js collides with G:\desktop\demo\node_modules\react-native\Libraries\StyleSheet\ColorPropType.js


This error is caused by a @providesModule declaration with the same name across two different files.

    at HasteMap._updateHasteMap (G:/desktop/demo/node_modules/react-native/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js:158:13)

    at module.getName.then.name (G:/desktop/demo/node_modules/react-native/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js:119:31)

    at <anonymous>

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! demo@0.0.1 start: `node node_modules/react-native/local-cli/cli.js start`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the demo@0.0.1 start script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


npm ERR! A complete log of this run can be found in:

npm ERR!     C:\Users\ze258\AppData\Roaming\npm-cache\_logs\2018-06-24T07_46_58_460Z-debug.log

于是我删除node_module,重新npm install,这个错误依然存在,即使用git把代码回退到以前的版本,这个bug还是存在,没有百度到合适结果。PS:windows10系统

写回答

2回答

超频散热

提问者

2018-06-25

我把github上提交的代码clone下来,npm install && react-native run-android 之后,就OK了

0
0

CrazyCodeBoy

2018-06-24

清除npm缓存然后重新运行(C:\Users\ze258\AppData\Roaming\npm-cache);

可参考:https://github.com/facebook/react-native/issues/7384


0
0

React Native技术精讲与高质量上线App开发

一个真实的上线项目,一次完整的开发过程,全面掌握React Native技术

1577 学习 · 727 问题

查看课程