簡體   English   中英

無法從…/App.js 解析模塊“react-navigation”:Haste 模塊 map 中不存在模塊“react-navigation”

[英]Unable to resolve module 'react-navigation' from …/App.js: Module 'react-navigation' does not exist in the Haste module map

所以我剛剛設置了一個應用程序來開始構建它,我不斷地從我的 App.js 中收到這個錯誤。 這是 udemy 課程的一部分,在該課程中,我遵循了 T 的每條指令......所以我對到底發生了什么感到困惑,我已經遵循了我能找到的每一個建議。 無法從/Users/3x7r3m157/Development/React-Native/food/App.js解析模塊react-navigation :模塊react-navigation不存在於 Haste 模塊 Z1D78EZ8DC8ED512144E1455

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:

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);

確保安裝 react-navigation 和npm i react-navigation

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM