【问题标题】:Unable to resolve "./vendor/TransitionConfigs/CardStyleInterpolators" from "node_modules/react-navigation-stack/lib/module/index.js"无法从“node_modules/react-navigation-stack/lib/module/index.js”解析“./vendor/TransitionConfigs/CardStyleInterpolators”
【发布时间】:2020-04-23 03:37:10
【问题描述】:

我在创建导航堆栈时收到以下错误,如下所示:

无法从“node_modules/react-navigation-stack/lib/module/index.js”解析“./vendor/TransitionConfigs/CardStyleInterpolators”

App.js:-

import React from "react";

import {createAppContainer,createSwitchNavigator} from "react-navigation";

import {createStackNavigator} from "react-navigation-stack";

import {createBottomTabNavigator} from "react-navigation-tabs";

import AccountScreen from "./src/screens/AccountScreen";
import SigninScreen ......  ;

const switchNavigator=createSwitchNavigator({

    loginFlow:createStackNavigator({

        Signin:SigninScreen,
        Signup:SignupScreen

    }),

    mainFlow:createBottomTabNavigator({

        trackListFlow:createStackNavigator({

            TrackList:TrackListScreen,
            TrackDetails:TrackDetailsScreen

        }),

        TrackCreate:TrackCreateScreen,
        Account:AccountScreen

    })
});

export default createAppContainer(switchNavigator);

我正在使用以下依赖版本:-

Package.json:-

{

  "main": "node_modules/expo/AppEntry.js",

  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },

  "dependencies": {

    "expo": "~36.0.0",

    "react": "~16.9.0",

    "react-dom": "~16.9.0",

    "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz",

    "react-native-gesture-handler": "^1.5.3",

    "react-native-reanimated": "^1.4.0",

    "react-native-web": "~0.11.7",

    "react-navigation": "^4.0.10",

    "react-navigation-stack": "^1.10.3",

    "react-navigation-tabs": "^2.7.0"

  },
  "devDependencies": {

    "babel-preset-expo": "~8.0.0",

    "@babel/core": "^7.0.0"

  },

  "private": true

}

虽然我使用的是所有依赖项的稳定版本,但捆绑时出现以下错误...

【问题讨论】:

    标签: reactjs react-native expo


    【解决方案1】:

    你需要清除你的地铁缓存。

    由于您使用的是 Expo,请先停止 Expo 服务器。然后运行:

    expo start -c
    

    如果不是,请运行:

    react-native start --reset-cache
    

    【讨论】:

      猜你喜欢
      • 2020-06-05
      • 2019-09-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-02-16
      • 2019-03-10
      • 2020-05-19
      相关资源
      最近更新 更多