2017-04-21 26 views
6

当我安装NativeBase并作出反应,本机路由器焊剂在我反应过来本地项目中,我得到这个错误:重复模块名称:反应母语 - 矢量图标

Failed to build DependencyGraph: @providesModule naming collision: 
    Duplicate module name: react-native-vector-icons 
    Paths: /Users/vittori/Desktop/repos/GitHubExamples/native-starter-kit/node_modules/react-native/local-cli/core/__fixtures__/files/package.json collides with /Users/vittori/Desktop/repos/GitHubExamples/native-starter-kit/node_modules/react-native-router-flux/node_modules/react-native/local-cli/core/__fixtures__/files/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-vector-icons 
    Paths: /Users/vittori/Desktop/repos/GitHubExamples/native-starter-kit/node_modules/react-native/local-cli/core/__fixtures__/files/package.json collides with /Users/vittori/Desktop/repos/GitHubExamples/native-starter-kit/node_modules/react-native-router-flux/node_modules/react-native/local-cli/core/__fixtures__/files/package.json 

This error is caused by a @providesModule declaration with the same name across two different files. 
    at HasteMap._updateHasteMap (/Users/vittori/Desktop/repos/GitHubExamples/native-starter-kit/node_modules/react-native/packager/src/node-haste/DependencyGraph/HasteMap.js:159:13) 
    at p.getName.then.name (/Users/vittori/Desktop/repos/GitHubExamples/native-starter-kit/node_modules/react-native/packager/src/node-haste/DependencyGraph/HasteMap.js:134:31) 
+0

我在与'反应母语start'启动时,会出现完全一样的问题。运行'npm i'的确有一些反应,反应本机,反应本地映射,反应本机和反应静态容器的一些警告需要反应的同伴。我已经尝试了很多东西,例如清理npm缓存,删除node_modules,使用react-native进行升级。让我知道你是如何得到的:) –

回答

0

你应该能够更新 react-native-router-flux使用: npm i react-native-router-flux --save

这可能是试图启动反应本地打包仍不能运行,可能是有用的:

1. Clear watchman watches: `watchman watch-del-all`. 2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`. 3. Reset packager cache: `rm -fr $TMPDIR/react-*` or `npm start --reset-cache`.

您可能会看到一次尝试再次运行打包错误,如:

Failed to build DependencyGraph: @providesModule naming collision: Duplicate module name

您可能需要运行故宫再次安装反应本地路由器通量。

+0

用新的代码库尝试了这些指令3次。也尝试清除所有的东西,并使用'yarn.'同样的错误发生 – Tony

0

如果纱工作,请运行此命令。 yarn add [email protected]

如果您使用npm,请运行此命令。 npm install [email protected] --save

此外,您仍然遇到问题,请将react-native版本降级到0.41.2。

然后,它会工作。

0

NativeBase 2.1.4解决了这个问题