繁体   English   中英

ios 模拟器未在 expo 反应原生项目中启动

[英]ios simulator not launching in expo react native project

我知道有很多关于这个问题的帖子,我已经完成了所有的解决方案。 我安装了 Xcode 更新。 我将 expo 更新到最新版本。 我完全重置了模拟器。 我不知道还有什么要做...

(node:89825) UnhandledPromiseRejectionWarning: Error: xcrun exited with non-zero code: 4 at ChildProcess.completionListener (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13) at Object.onceWrapper (events.js:422:26) at ChildProcess.emit (events.js:315:20) at maybeClose (internal/child_process.js:1048:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)... at spawnAsync (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19) at xcrunAsync (/@expo/xdl@59.0.5/src/SimControl.ts:335:18) at Object.bootAsync (/@expo/xdl@59.0.5/src/SimControl.ts:137:11) at action (/@expo/xdl@59.0.5/src/Simulator.ts:310:25) at waitForActionAsync (/@expo/xdl@59.0.5/src/Simulator.ts:292:22) at ensureSimulatorOpenAsync (/@expo/xdl@59.0.5/src/Simulator.ts:207:24) at Object.openProjectAsync (/@expo/xdl@59.0.5/src/Simulator.ts:653:14) at ReadStream.handleKeypress (/usr/local/lib/node_modules/expo-cli/src/commands/start/TerminalUI.ts:224:11) (node:89825) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with.catch(). To terminate the node process on unhandled promise rejection, use the CLI flag (node:89825) UnhandledPromiseRejectionWarning: Error: xcrun exited with non-zero code: 4 at ChildProcess.completionListener (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13) at Object.onceWrapper (events.js:422:26) at ChildProcess.emit (events.js:315:20) at maybeClose (internal/child_process.js:1048:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)... at spawnAsync (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19) at xcrunAsync (/@expo/xdl@59.0.5/src/SimControl.ts:335:18) at Object.bootAsync (/@expo/xdl@59.0.5/src/SimControl.ts:137:11) at action (/@expo/xdl@59.0.5/src/Simulator.ts:310:25) at waitForActionAsync (/@expo/xdl@59.0.5/src/Simulator.ts:292:22) at ensureSimulatorOpenAsync (/@expo/xdl@59.0.5/src/Simulator.ts:207:24) at Object.openProjectAsync (/@expo/xdl@59.0.5/src/Simulator.ts:653:14) at ReadStream.handleKeypress (/usr/local/lib/node_modules/expo-cli/src/commands/start/TerminalUI.ts:224:11) (node:89825) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with.catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 13) (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 13)

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@react-native-community/masked-view": "^0.1.10",
    "@react-navigation/native": "^5.8.10",
    "expo": "~39.0.2",
    "expo-status-bar": "~1.0.2",
    "lottie-ios": "^3.1.8",
    "lottie-react-native": "^3.5.0",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-39.0.4.tar.gz",
    "react-native-gesture-handler": "~1.7.0",
    "react-native-reanimated": "~1.13.0",
    "react-native-safe-area-context": "3.1.4",
    "react-native-screens": "~2.10.1",
    "react-native-web": "~0.13.12",
    "react-navigation": "^4.4.3",
    "react-navigation-stack": "^2.10.2"
  },
  "devDependencies": {
    "@babel/core": "~7.9.0"
  },
  "private": true
}

找到解决方案!

我不得不将.expo 的所有权更改给我。 我用以下命令解决了这个问题

sudo chown -R MYUSERNAME /Users/MYUSERNAME/.expo/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM