Haste 模块映射中不存在模块 `react-navigation-tabs`

THI*_*las 2 react-native react-navigation

我尝试在 React Native 中创建标签导航。但是当我想导入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-*`.

谢谢你的帮助。

sat*_*164 7

安装react-navigation-tabs

yarn add react-navigation-tabs
Run Code Online (Sandbox Code Playgroud)

或者

npm install react-navigation-tabs
Run Code Online (Sandbox Code Playgroud)

然后运行地铁:

react-native start --reset-cache
Run Code Online (Sandbox Code Playgroud)

还要确保您已按照此处的说明进行操作:https : //reactnavigation.org/docs/en/getting-started.html