0

I have installed all the dependencies according to the react navigation docs.. when I copied code from docs this error occurs.. my dependencies are

"dependencies": {
    "@react-native-community/masked-view": "^0.1.6",
    "@react-navigation/native": "^5.0.5",
    "@react-navigation/stack": "^5.0.5",
    "react": "16.9.0",
    "react-native": "0.61.5",
    "react-native-gesture-handler": "^1.6.0",
    "react-native-paper": "^3.6.0",
    "react-native-reanimated": "^1.7.0",
    "react-native-safe-area-context": "^0.7.3",
    "react-native-screens": "^2.0.0-beta.7"
  },
4

1 回答 1

0

安卓解决方案

从您的项目根文件夹运行:

  1. cd android
  2. ./gradlew clean
  3. 运行项目react-native run-android

IOS 解决方案

从您的项目根文件夹运行:

  1. cd ios

  2. pod install

  3. 运行项目react-native run-ios

如果这些解决方案不起作用,请删除您的node_modules文件夹并使用重新安装npm install

笔记 :

  • 不要使用 react-native 链接链接包,因为您使用的是 RN 0.60 >
于 2020-02-19T15:37:53.500 回答