无法从.../App.js解析模块“反应导航":Haste模块映射中不存在模块“反应导航" [英] Unable to resolve module 'react-navigation' from .../App.js: Module 'react-navigation' does not exist in the Haste module map

查看:83
本文介绍了无法从.../App.js解析模块“反应导航":Haste模块映射中不存在模块“反应导航"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚设置了一个应用程序以开始构建该应用程序,但我不断从App.js中收到此错误.这是一个反复无常的课程的一部分,在该课程中,我已经按照每条T指令进行操作...因此,我对到底发生了什么感到困惑,并且已经遵循了我所能找到的所有建议.无法从/Users/3x7r3m157/Development/React-Native/food/App.js解决模块反应导航:急速模块图中不存在模块反应导航.

I have just setup an app to start building it out and I keep getting this error from my App.js. This is a part of a udemy course in which I have followed every instruction to a T... so I am beyond confused of what the hell is happening and I have followed every suggestion I can find. Unable to resolve module react-navigation from /Users/3x7r3m157/Development/React-Native/food/App.js: Module react-navigation does not exist in the Haste module map.

This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
  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-*`.

facebook::ReactABI35_0_0::JSIExecutor::defaultTimeoutInvoker(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>)
facebook::ReactABI35_0_0::JSIExecutor::defaultTimeoutInvoker(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>)
ED0789CD-8D80-39F4-9651-D8707D9C0337
ED0789CD-8D80-39F4-9651-D8707D9C0337
_dispatch_main_queue_callback_4CF
97285ACB-7B21-393A-ABF6-03F1DBB5D2A2
97285ACB-7B21-393A-ABF6-03F1DBB5D2A2
CFRunLoopRunSpecific
GSEventRunModal
UIApplicationMain
Exponent
0DC9A4BA-C3E8-3487-99DB-1B5C86597AF5

这是我的App.js:

Here is my App.js:

import { createAppContainer } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
import SearchScreen from './src/screens/SearchScreen';

const navigator = createStackNavigator ({
  Search: SearchScreen
}, {
  initialRouteName: 'Search',
  defaultNavigationOptions: {
    title: 'BusinessSearch'
  }
});

export default createAppContainer(navigator);

推荐答案

确保使用 npm i react-navigation

这篇关于无法从.../App.js解析模块“反应导航":Haste模块映射中不存在模块“反应导航"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆