【问题标题】:error Option "--entry-file" is missing. Run CLI with --verbose flag for more details错误选项“--entry-file”丢失。使用 --verbose 标志运行 CLI 以获取更多详细信息
【发布时间】:2020-01-09 12:00:19
【问题描述】:

我尝试安装本机反应,当我输入命令 npm run android-windows there;s error.

如何解决?

这是我的packages.json

{ “名称”:“Fyp”, “版本”:“0.0.1”, “私人”:真的, “脚本”:{ "start": "react-native start", “测试”:“开玩笑”, "lint": "eslint.", "android-windows": "react-native bundle --platform android --dev false npm run android-windows--entry-file index.js --bundle-output android/app/src/main/assets/index.android .bundle --assets-dest android/app/src/main/res && react-native run-android" }, “依赖”:{ “反应”:“16.8.6”, “反应原生”:“0.60.5” }, “开发依赖”:{ "@babel/core": "7.5.5", "@babel/runtime": "7.5.5", "@react-native-community/eslint-config": "0.0.3", "babel-jest": "24.9.0", “eslint”:“6.3.0”, “笑话”:“24.9.0”, “metro-react-native-babel-preset”:“0.54.1”, “反应测试渲染器”:“16.8.6” }, “开玩笑”:{ “预设”:“反应原生” } }

这是错误

错误选项“--entry-file”丢失。使用 --verbose 标志运行 CLI 以获取更多详细信息。 错误:缺少选项“--entry-file” 在 C:\Users\user\Fyp\node_modules\react-native\node_modules@react-native-community\cli\build\tools\assertRequiredOptions.js:51:13 在 Array.forEach () 在 assertRequiredOptions (C:\Users\user\Fyp\node_modules\react-native\node_modules@react-native-community\cli\build\tools\assertRequiredOptions.js:40:11) 在 Command.handleAction (C:\Users\user\Fyp\node_modules\react-native\node_modules@react-native-community\cli\build\cliEntry.js:159:42) 在 Command.listener (C:\Users\user\Fyp\node_modules\commander\index.js:315:8) 在 Command.emit (events.js:209:13) 在 Command.parseArgs (C:\Users\user\Fyp\node_modules\commander\index.js:651:12) 在 Command.parse (C:\Users\user\Fyp\node_modules\commander\index.js:474:21) 在 setupAndRun (C:\Users\user\Fyp\node_modules\react-native\node_modules@react-native-community\cli\build\cliEntry.js:210:24) 在 Object.run (C:\Users\user\Fyp\node_modules\react-native\node_modules@react-native-community\cli\build\cliEntry.js:173:11) npm 错误!代码生命周期 npm 错误!错误号 1 npm 错误! Fyp@0.0.1 安卓窗口:react-native bundle --platform android --dev false npm run android-windows--entry-file index.js --bundle-output android/app/src/main/ass ets/index.android.bundle --assets-dest android/app/src/main/res && react-native run-android npm 错误!退出状态 1 npm 错误! npm 错误! Fyp@0.0.1 android-windows 脚本失败。 npm 错误!这可能不是 npm 的问题。上面可能还有额外的日志输出。

npm 错误!可以在以下位置找到此运行的完整日志: npm 错误! C:\Users\user\AppData\Roaming\npm-cache_logs\2019-09-06T15_03_19_543Z-debug.log

【问题讨论】:

    标签: android node.js reactjs react-native npm


    【解决方案1】:

    试试这个命令:

    react-native bundle --dev false --platform android --entry-file index.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle --assets-dest ./android/app/build/intermediates/res/merged/debug
    

    参考链接:how to build apk file

    【讨论】:

      【解决方案2】:

      试试这个命令:

      react-native bundle --dev false --platform android  --entry-file index.js --bundle-output ./android/app/src/main/assets/index.android.bundle --assets-dest ./android/app/src/main/res
      

      链接here需要修复

      【讨论】:

        猜你喜欢
        • 2019-10-21
        • 2020-04-01
        • 2018-10-13
        • 2020-05-19
        • 1970-01-01
        • 2014-07-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多