【问题标题】:Can't run React Native on Catalina无法在 Catalina 上运行 React Native
【发布时间】:2020-04-13 14:55:57
【问题描述】:

当我尝试在模拟器中运行 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 ios-simulator


【解决方案1】:

没有正确安装 React Native。

【讨论】:

    【解决方案2】:

    这个也让我抓狂,每次我更新我的操作系统时都会得到它。您的 Xcode 版本可能与您的 RN 版本冲突。

    尝试以下几种方法的组合:

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

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

    祝你好运

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-16
      • 2021-12-20
      • 2020-05-16
      • 1970-01-01
      相关资源
      最近更新 更多