“@react-navigation/stack”已停止工作并出现错误 - 无法解析模块

'@react-navigation/stack' has stopped working with error - unable to resolve module

我已经成功使用 React Navigation Stack (V5) 大约一个星期了,今天我的应用程序无法构建,因为现在显示错误 - 无法解析模块。

Error Message

模块已安装,如我的 package.json 文件所示 -

{
  "scripts": {
    "postinstall": "jetify",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "web": "expo start --web",
    "start": "react-native start",
    "test": "jest"
  },
  "dependencies": {
    "@react-native-community/masked-view": "^0.1.6",
    "expo": "~36.0.0",
    "expo-linear-gradient": "^8.0.0",
    "react": "~16.9.0",
    "react-dom": "~16.9.0",
    "react-native": "~0.61.4",
    "react-native-fontawesome": "^7.0.0",
    "react-native-gesture-handler": "^1.5.6",
    "react-native-keyboard-aware-scroll-view": "^0.9.1",
    "react-native-reanimated": "^1.7.0",
    "react-native-safe-area-context": "^0.7.2",
    "react-native-screens": "^2.0.0-beta.2",
    "react-native-unimodules": "~0.7.0",
    "react-native-web": "~0.11.7",
    "react-navigation": "^4.0.10",
    "react-navigation-stack": "^1.10.3"
  },
  "devDependencies": {
    "@babel/core": "~7.6.0",
    "babel-jest": "~24.9.0",
    "jest": "~24.9.0",
    "jetifier": "~1.6.4",
    "metro-react-native-babel-preset": "~0.56.0",
    "react-test-renderer": "~16.9.0"
  },
  "jest": {
    "preset": "react-native"
  },
  "private": true
}

我已经尝试了以下步骤来尝试解决问题 -

  1. 已删除node_modules
  2. 已清除 yarn 和 npm 缓存
  3. 运行 npm install 再次安装依赖[=​​32=]
  4. 已清除博览会缓存
  5. 已删除并重新下载 iOS 设备上的 expo 应用程序
  6. 也尝试再次安装反应导航堆栈包

仍然收到相同的错误消息。

非常感谢任何想法.. 目前我对此失去了理智:|

尝试删除 package-lock 文件和 运行 npm i

您的 package.json 中没有@react-navigation/stack 或任何@react-navigation/xxx 软件包。您有适用于 v4 的 react-navigation-xxx 包。

按照入门指南正确设置它https://reactnavigation.org/docs/en/getting-started.html