这似乎是在开发过程中随机发生的。当尝试运行 npm start
或 react-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
实际上将 react-native-vector-icons
列为该模块的名称???
如果我删除那个文件,错误就不会再发生了,但打包程序会在93%处卡住,并抱怨找不到一个完全无关的库。
我清除了我的存储库,甚至重新安装了所有东西,包括 npm
、rnpm
,甚至升级了 node
。我正在运行与我的团队成员相同版本的一切,他们能够无问题地运行打包程序。