无法 运行 在 Catalina 上 React Native

Can't run React Native on Catalina

当我尝试在模拟器中 运行 React Native App 时,我得到了这个:

Error: Could not find iPhone X simulator
    at resolve (/Users/hugh/code/iosapps/Test/node_modules/react-native/local-cli/runIOS/runIOS.js:149:13)
    at new Promise (<anonymous>)
    at runOnSimulator (/Users/hugh/code/iosapps/Test/node_modules/react-native/local-cli/runIOS/runIOS.js:134:10)
    at Object.runIOS [as func] (/Users/hugh/code/iosapps/Test/node_modules/react-native/local-cli/runIOS/runIOS.js:106:12)
    at Promise.resolve.then (/Users/hugh/code/iosapps/Test/node_modules/react-native/local-cli/cliEntry.js:117:22)

模拟器存在于我的系统中,但 React Native 找不到它。

请帮帮我!

没有正确安装 React Native。

这个也让我发疯,我每次更新 OS 都会得到它。您的 Xcode 版本可能与您的 RN 版本冲突。

尝试组合使用这些东西:

在你做任何事情之前确保你有你的项目的工作备份

  • 升级 React Native 项目版本(如果可能)react-native upgrade
  • 删除 node_modules 并重新安装 rm -rf node_modules 然后 npm iyarn
  • 删除您的 .lock 文件和 运行 npm iyarn

祝你好运