CLI的博览会启动失败

时间:2020-05-19 05:09:15

标签: react-native expo

expo start运作良好,但是尝试使用expo build:ios构建ios独立应用后,expo start失败,并显示错误消息:

Expo DevTools is running at http://localhost:19002
Opening DevTools in the browser... (press shift-d to disable)
error Unrecognized command "start".

info Run "react-native --help" to see a list of all available commands.
Metro Bundler process exited with code 1
Error: Metro Bundler process exited with code 1
    at ChildProcess.<anonymous> (/@expo/xdl@57.9.9/src/Project.ts:1838:16)
    at Object.onceWrapper (events.js:428:26)
    at ChildProcess.emit (events.js:321:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

我尝试在全局范围内重新安装带有yarn的expo-cli,但这不能解决问题。

expo diagnotics输出为:

  Expo CLI 3.20.9 environment info:
    System:
      OS: macOS 10.15.2
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 13.6.0 - /usr/local/bin/node
      Yarn: 1.21.1 - /usr/local/bin/yarn
      npm: 6.13.4 - /usr/local/bin/npm
    IDEs:
      Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
    npmPackages:
      expo: ^36.0.2 => 36.0.2
      react: ~16.9.0 => 16.9.0
      react-dom: ~16.9.0 => 16.9.0
      react-native: https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz => 0.61.4
      react-native-web: ^0.12.1 => 0.12.2

1 个答案:

答案 0 :(得分:0)

由于将错误的路径引用混入文件中,我试图在Windows上使用React native(然后从项目中删除它)后遇到了相同的错误:react-native.config.js和metro.config.js 。我刚刚删除了它们,现在可以使用。