纱线运行错误:找不到模块 - 反应本机



所以,我正在设置新的React Native项目,我正在尝试设置XCode模拟器。当我从项目文件夹运行"yarn run ios"时,我已经在 XCode 和终端中打开了我的 React Native 项目,我收到错误"错误:找不到模块'@babel/运行时/助手/互操作要求默认值" 在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.
 

有人知道如何解决这个问题吗?

我通过运行解决了它:

yarn add @babel/runtime

相关内容

  • 没有找到相关文章

最新更新