React-Native:错误:无法解析模块`SegmentedControlIOS`

问题描述 投票:2回答:2

当我更新到xCode 10时,我得到一个奇怪的错误。错误说

error: bundling failed: Error: Unable to resolve module `SegmentedControlIOS` from `/node_modules/react-native/Libraries/react-native/react-native-implementation.js`: Module does not exist in the module map

This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
  1. Clear watchman watches: `watchman watch-del-all`.
  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.

我正在使用以下版本的反应ana babel:

“babel-preset-react-native”:“4.0.0”,“react-native”:“0.54.0”,

我试图重新安装节点模块。但它没有用。

让我知道是否有人有同样的问题,并能够解决它。

谢谢,

enter image description here

reactjs react-native xcode10
2个回答
0
投票

像往常一样重置缓存它每次都像魅力一样工作。


0
投票

你能让这个工作吗?如果没有,请先尝试在单独的终端上启动metro捆绑器(项目的npm start)。这听起来像我得到的。如果您尝试在不运行metro捆绑器的情况下执行npm start ios,则会在node_modules中设置工作目录,这就是为什么它找不到您的任何文件。

© www.soinside.com 2019 - 2024. All rights reserved.