这在开发过程中似乎是随机发生的。尝试运行npm start
orreact-native run-ios
时,出现以下错误:
Failed to build DependencyGraph: @providesModule naming collision:
Duplicate module name: react-native-vector-icons
Paths: /Users/chandlervdw/Repos/Relay/mobile/node_modules/react-native/local-cli/rnpm/core/test/fixtures/files/package.json collides with /Users/chandlervdw/Repos/Relay/mobile/node_modules/react-native/Libraries/Animated/release/package.json
This error is caused by a @providesModule declaration with the same name accross two different files.
Error: @providesModule naming collision:
Duplicate module name: react-native-vector-icons
Paths: /Users/chandlervdw/Repos/Relay/mobile/node_modules/react-native/local-cli/rnpm/core/test/fixtures/files/package.json collides with /Users/chandlervdw/Repos/Relay/mobile/node_modules/react-native/Libraries/Animated/release/package.json
This error is caused by a @providesModule declaration with the same name accross two different files.
at HasteMap._updateHasteMap (/Users/chandlervdw/Repos/Relay/mobile/node_modules/node-haste/lib/DependencyGraph/HasteMap.js:162:15)
at /Users/chandlervdw/Repos/Relay/mobile/node_modules/node-haste/lib/DependencyGraph/HasteMap.js:140:25
奇怪的是,/Users/chandlervdw/Repos/Relay/mobile/node_modules/react-native/local-cli/rnpm/core/test/fixtures/files/package.json
实际上确实 listreact-native-vector-icons
作为模块的名称???
如果我删除该文件,则错误不再发生,但打包程序卡在 93% 并抱怨找不到完全不相关的库。
我吹走了我的回购,甚至重新安装了所有东西,包括npm
, rnpm
,甚至升级node
. 我正在运行与我的队友相同的所有版本,他们能够毫无问题地运行打包程序。