React Native 错误 - 无法解析模块`./tab-bar-item-ios`

React Native error - Unable to resolve module `./tab-bar-item-ios`

我刚刚将 react-native-vector-icons 从版本 7.1 升级到 8.0......现在我收到以下错误:

    unable to resolve module `./tab-bar-item-ios` from `node_modules\react-native-vector-icons\lib\create-icon-set.js`
    None of these files exist:
  * node_modules\react-native-vector-icons\lib\tab-bar-item-ios(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx).........etc

我正在真实的 Android 设备上使用 windows 计算机进行测试。 有什么想法吗?

你在指定 react-native-vector-icons 的版本时是否使用了插入符号 (^)? 我收到了同样的错误消息,在删除 '^'

后它对我有用

"react-native-vector-icons": "^8.0.0" => "react-native-vector-icons": "8.0.0"

这是一个缓存问题,你可以修复它运行:

react-native start --reset-cache

创建此帐户只是为了回答您的问题呵呵,我知道这些错误是多么令人沮丧。