OGeek|极客世界-中国程序员成长平台

标题: ios - yarn 运行 ios - 错误 : Cannot find module - React Native [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 16:05
标题: ios - yarn 运行 ios - 错误 : Cannot find module - React Native

因此,我正在设置新的 React Native 项目,并且我正在尝试设置 XCode 模拟器。当我从项目文件夹运行“yarn run ios”时,我在 XCode 和终端中打开了我的 React Native 项目,我收到错误“错误:找不到模块'@ babel/runtime/helpers/interopRequireDefault' 在 Function.Module._resolveFilename"。

    My-MacBook-Pro-2:projectZero alexs$ yarn run ios
yarn run v1.13.0
$ react-native run-ios
internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module '@babel/runtime/helpers/interopRequireDefault'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/Users/alexs/Desktop/React/Native/projectZero/node_modules/react-native/local-cli/cliEntry.js:11:41)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Module._compile (/Users/alexs/Desktop/React/Native/projectZero/node_modules/pirates/lib/index.js:83:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.newLoader [as .js] (/Users/alexs/Desktop/React/Native/projectZero/node_modules/pirates/lib/index.js:88:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
error Command failed with exit code 1.
 


Best Answer-推荐答案


我通过运行解决了它:

yarn add @babel/runtime

关于ios - yarn 运行 ios - 错误 : Cannot find module - React Native,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54492738/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://jike.in/) Powered by Discuz! X3.4