首页 > 解决方案 > React 本机运行时错误,如何解决?

问题描述

我已经重置了地铁,但同样的问题正在发生。我怎么解决这个问题?当我更改端口时,也会发生同样的问题。我在重建项目时遇到了同样的问题。

在此处输入图像描述

    {
  "name": "meal",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-firebase/app": "^12.4.0",
    "@react-native-firebase/database": "^12.4.0",
    "@react-native-firebase/firestore": "^12.4.0",
    "@react-native-firebase/messaging": "^12.4.0",
    "@react-native-firebase/storage": "^12.4.0",
    "@react-native-picker/picker": "^1.16.3",
    "@react-navigation/bottom-tabs": "^5.11.11",
    "@react-navigation/drawer": "^5.12.5",
    "@react-navigation/native": "^5.9.4",
    "@react-navigation/stack": "^5.14.5",
    "@reduxjs/toolkit": "^1.6.0",
    "add": "^2.0.6",
    "babel-preset-react-native": "^5.0.2",
    "firebase-admin": "^9.11.0",
    "lottie-react-native": "^4.0.2",
    "moment": "^2.29.1",
    "react": "17.0.1",
    "react-dom": "^17.0.2",
    "react-icons": "^4.2.0",
    "react-is": "^17.0.2",
    "react-native": "0.64.1",
    "react-native-animated-loader": "^0.0.9",
    "react-native-chart-kit": "^6.11.0",
    "react-native-checkbox-selection": "^1.1.0",
    "react-native-date-picker": "^3.3.2",
    "react-native-dropdown-picker": "^5.1.21",
    "react-native-elements": "^3.4.1",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-image-picker": "^4.0.3",
    "react-native-navigation-bar-color": "^2.0.1",
    "react-native-picker-select": "^8.0.4",
    "react-native-push-notification": "^7.4.0",
    "react-native-reanimated": "^2.0.0",
    "react-native-router-flux": "^3.45.0",
    "react-native-safe-area-context": "^3.2.0",
    "react-native-screens": "^3.3.0",
    "react-native-splash-screen": "^3.2.0",
    "react-native-svg": "^12.1.1",
    "react-native-vector-icons": "^8.1.0",
    "react-redux": "^7.2.4",
    "yarn": "^1.22.11"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/highlight": "^7.14.5",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-jest": "^26.6.3",
    "eslint": "7.14.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "^0.64.0",
    "react-test-renderer": "17.0.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

标签: react-nativereact-reduxreact-native-android

解决方案


删除 node_modules 和 package-lock.json。安装一切新鲜的,它应该工作。


推荐阅读