2017-10-16 77 views
2

我正在嘗試使用命令yarn add react-native-navigation-drawer在我的項目上安裝react-native-navigation-drawer錯誤添加模塊:提供此模塊的幾個文件

執行命令後,我運行應用程序時出現錯誤。

/Users/reactProject/node_modules/react-native/package.json 
2017-10-16 15:10:43.664017+0200 mobilizeit[23431:100610] Ambiguous resolution: module '/Users/reactProject/index.ios.js' tries to require 'react-native', but there are several files providing this module. You can delete or fix them: 

/Users/reactProject/node_modules/react-native-drawer-layout-polyfill/node_modules/react-native/package.json 

/Users/reactProject/node_modules/react-native-navigation-drawer/node_modules/react-native/package.json 

/Users/reactProject/node_modules/react-native-tab-view/node_modules/react-native/package.json 

/Users/reactProject/node_modules/react-native/package.json 

我對反應原生很新。你能幫我解決這個問題嗎? 編輯:

用命令yarn start --reset-cache我得到了很多,看起來像警告:

This warning is caused by a @providesModule declaration with the same name across two different files. 
jest-haste-map: @providesModule naming collision: 
    Duplicate module name: Sample 
    Paths: /Users/reactProject/node_modules/react-native-navigation-drawer/node_modules/react-native/Libraries/Sample/Sample.ios.js collides with /Users/reactProject/node_modules/react-native-drawer-layout-polyfill/node_modules/react-native/Libraries/Sample/Sample.ios.js 

This warning is caused by a @providesModule declaration with the same name across two different files. 
jest-haste-map: @providesModule naming collision: 
    Duplicate module name: Settings 
    Paths: /Users/reactProject/node_modules/react-native-navigation-drawer/node_modules/react-native/Libraries/Settings/Settings.ios.js collides with /Users/reactProject/node_modules/react-native-drawer-layout-polyfill/node_modules/react-native/Libraries/Settings/Settings.ios.js 

回答

0

試試這個命令

yarn start --reset-cache 
+0

我更新的問題 –