【问题标题】:Error adding module: Several files providing this module添加模块时出错:提供此模块的几个文件
【发布时间】:2018-03-28 00:49:15
【问题描述】:

我正在尝试使用命令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

我对 react-native 很陌生。你能帮我解决问题吗? 编辑:

使用命令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

【问题讨论】:

    标签: reactjs react-native npm yarnpkg


    【解决方案1】:

    试试这个命令

     yarn start --reset-cache
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-07-16
      • 2019-10-20
      • 2020-04-30
      • 1970-01-01
      • 2020-11-01
      • 1970-01-01
      • 2018-02-01
      相关资源
      最近更新 更多