【问题标题】:React Native Development Server Error 500React Native 开发服务器错误 500
【发布时间】:2020-02-19 23:14:52
【问题描述】:

嘿,我正在尝试在 react-native 中制作我的第一个应用程序,但在尝试安装 react-navigation 和 react-navigation 堆栈后遇到了问题。

当我尝试运行 react-native start 时出现此错误:

 BUNDLE  [android, dev] ./index.js ▓▓▓▓▓▓▓▓▓░░░░░░░ 57.2% (431/570)::ffff:127.0.0.1 - - [19/Feb/2020:23:06:17 +0000] "GET /index.bundle?platform=android&dev=true&minify=false HTTP/1.1" 500 - "-" "okhttp/3.12.1"
error: bundling failed: Error: Unable to resolve module `@react-native-community/masked-view` from `node_modules/react-navigation-stack/lib/module/vendor/views/MaskedView.native.js`: @react-native-community/masked-view could not be found within the project.

但我的节点模块文件夹中有 react-native-community 并尝试再次安装它,但当我执行 npm install react-native-community 时它似乎不存在。

我也不确定这是否相关,但是当我执行 react-native run-android 时,它现在在 app:installDebug 步骤中卡在 99%。

编辑:修复需要执行 npm install @react-native-community/masked-view

【问题讨论】:

  • 你能分享你的 package.json 文件吗?

标签: android reactjs react-native npm node-modules


【解决方案1】:

在你的项目中安装它

expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view

https://reactnavigation.org/docs/getting-started

【讨论】:

  • 是的,它可以工作...非常感谢,上帝保佑这些断点升级的原生反应:|
  • 这是这个问题的答案。
【解决方案2】:

在工作文件夹中运行npm list 以查看项目文件夹中的所有依赖项并注意UNMET PEER DEPENDENCY,然后安装所有未满足的依赖项

【讨论】:

    【解决方案3】:

    "@react-native-community/masked-view" 这个依赖产生错误。我认为您使用 react-native-navigation 会产生问题,因为在最新的 react-native(Version> 0.60) 中,此问题正在发生,但 Version

    【讨论】:

      【解决方案4】:

      如果您收到此错误

      Unable to resolve "@react-native-community/masked-view" from "node_modules\react-navigation-stack\lib\module\vendor\views\MaskedView.native.js
      

      运行npm install @react-native-community/masked-view

      【讨论】:

        猜你喜欢
        • 2020-04-29
        • 1970-01-01
        • 1970-01-01
        • 2021-09-16
        • 2017-06-07
        • 2022-01-11
        • 2017-04-09
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多