react-native - 模块 `react-navigation-tabs` 在急速模块 map 中不存在

标签 react-native react-navigation

我尝试在 native react 中创建一个选项卡导航。但是当我要导入import { createBottomTabNavigator } from 'react-navigation-tabs'; .我有以下错误:bundling failed: Error: Unable to resolve module `react-navigation-tabs` from `/Users/nicolasthibault/Desktop/RunApplication/Runenger/Views/NavigationReact.js`: Module `react-navigation-tabs` does not exist in the Haste module map .

我尝试了许多我发现类似主题的命令,但其中任何一个都适用于我的情况。
例如,我尝试了这些,但它并没有解决我的问题。
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-*`.
谢谢你的帮助。

最佳答案

1) 使用 npm 或 yarn 安装“react-navigation-tabs”
2) 使用 npm start --reset-cache 构建你的项目,如果你使用 expo 使用 expo r -c

它会工作的。

关于react-native - 模块 `react-navigation-tabs` 在急速模块 map 中不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58261300/

相关文章:

javascript - 将属性添加到 React Native 对象数组

javascript - React-Native 将两个数组合并为一个

reactjs - 使用redux-form按下下一个键盘按钮后如何使用useRef Hook 选择下一个TextInput

javascript - 在expo react-native中打开键盘时如何隐藏TabBar

react-native - 如何隐藏 react 导航的TabNavigator的标题我想只显示图标

javascript - onesignal 与 react 导航和 redux : i am not able to navigate to screen when notification is opened

javascript - Firestore - 如何在 native react 中通过 id 获取文档

android - 调试适配器 : SyntaxError: Unexpected token L in JSON at position 0 中未处理的错误

react-native - 使用对象作为参数调用导航时,您需要指定名称或键

react-native - 在 react-navigation 5.x 选项卡中预加载嵌套堆栈