无法为iOS构建React Native应用

时间:2018-07-03 07:50:39

标签: react-native

我尝试在本主页面https://facebook.github.io/react-native/docs/getting-started.html上使用本教程,并在使用“ react-native run-ios”时收到错误消息:

error: bundling failed: ambiguous resolution: module `/Users/Macbook/Sites/ReactNative/node_modules/react-native/Libraries/react-native/react-native-implementation.js` tries to require `ReactNative`, but there are several files providing this module. You can delete or fix them: 

  * `/Users/Macbook/Sites/ReactNative/node_modules/react-native/Libraries/Renderer/shims/ReactNative.js`
  * `/Users/Macbook/Sites/ReactNative/package.json`

我从互联网上阅读,并尝试使用“ npm start---reset-cache”进行修复,但终端卡在:

Metro Bundler ready.

Loading dependency graph...jest-haste-map: @providesModule naming collision:
  Duplicate module name: ReactNative
  Paths: /Users/Macbook/Sites/ReactNative/package.json collides with /Users/Macbook/Sites/ReactNative/node_modules/react-native/Libraries/Renderer/shims/ReactNative.js

This warning is caused by a @providesModule declaration with the same name across two different files.
Loading dependency graph, done.

我的操作系统:MacOS 10.13.5

React Native:0.55.4

反应:16.3.1

Xcode CL:Xcode 9.4.1(9F2000)

0 个答案:

没有答案