【问题标题】:child_process could not be found within the project-- react native在项目中找不到 child_process - 反应原生
【发布时间】:2020-03-09 00:21:14
【问题描述】:

在 react native 0.61.4 上创建了一个新项目 复制了 0.55.4 上一个项目的屏幕和功能。 一切都已构建,但捆绑失败并出现以下错误:

错误:捆绑失败:错误:无法从 node_modules\jest-changed-files\node_modules\execa\index.js 解析模块 child_process:在项目中找不到子进程。

Error: Bundling failed

包.json:

{

  "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": {
    "execa": "^3.2.0",
    "jest-changed-files": "^24.9.0",
    "mockjs": "^1.1.0",
    "moment": "^2.24.0",
    "native-base": "^2.13.8",
    "react": "16.9.0",
    "react-moment": "^0.9.6",
    "react-month-picker": "^1.3.11",
    "react-native": "0.61.4",
    "react-native-datepicker-dialog": "0.0.9",
    "react-native-gesture-handler": "^1.5.0",
    "react-native-image-slider-show": "^1.0.3",
    "react-native-keyboard-aware-scroll-view": "^0.9.1",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-modal-datetime-picker": "^7.6.0",
    "react-native-month-selector": "^1.4.0",
    "react-native-responsive-screen": "^1.3.0",
    "react-native-simple-table": "0.0.3",
    "react-native-slideshow": "^1.0.1",
    "react-native-spinkit": "^1.5.0",
    "react-native-svg": "^9.13.3",
    "react-native-swipe-gestures": "^1.0.4",
    "react-navigation": "^4.0.10",
    "react-navigation-stack": "^1.10.3",
    "react-time-picker": "^3.7.2"
  },
  "devDependencies": {
    "@babel/core": "^7.6.4",
    "@babel/runtime": "^7.6.3",
    "@react-native-community/eslint-config": "^0.0.5",
    "babel-jest": "^24.9.0",
    "eslint": "^6.6.0",
    "jest": "^24.9.0",
    "metro-react-native-babel-preset": "^0.57.0",
    "path": "^0.12.7",
    "react-test-renderer": "16.9.0"
  },
  "jest": {
    "preset": "react-native"
  },
  "browser": { "child_process": false }
}

任何帮助将不胜感激!

【问题讨论】:

    标签: react-native npm react-native-android node-modules mobile-application


    【解决方案1】:

    请清理您的项目然后运行项目。某些库没有通过自动链接功能添加,因此请检查并正确添加,例如需要手动添加的 firebase 库。我附上了一些屏幕截图,请检查。

    【讨论】:

      【解决方案2】:

      检查您最近正在处理的任何文件,并确保您没有错误地将child_process 导入某处。就我而言,它是process,如上图所示。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-12-31
        • 2017-05-10
        • 1970-01-01
        • 1970-01-01
        • 2019-08-31
        • 1970-01-01
        相关资源
        最近更新 更多