2017-04-21 34 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解決了這個問題