我尝试在反应本机中创建选项卡导航。但是当我想导入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-*`.
感谢您的帮助。
安装react-navigation-tabs
:
yarn add react-navigation-tabs
或
npm install react-navigation-tabs
然后运行地铁:
react-native start --reset-cache
此外,请确保您已按照此处的说明进行操作:https://reactnavigation.org/docs/en/getting-started.html
1( 使用 npm 或 yarn 安装 'react-navigation-tabs' 2(使用npm start --reset-cache构建你的项目,如果你正在使用expo使用expo r -c
它会起作用的。