我尝试在 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/