简体   繁体   English

纱线运行ios-错误:找不到模块-React Native

[英]yarn run ios - Error: Cannot find module - React Native

So, I'm setting up new React Native project , and I'm trying to setup XCode simulator. 因此,我正在设置新的React Native项目 ,并且正在尝试设置XCode模拟器。 I've opened my React Native project in XCode and in the terminal when I run "yarn run ios" from a project folder I'm getting the error " Error: Cannot find module '@babel/runtime/helpers/interopRequireDefault' at Function.Module._resolveFilename ". 当我从项目文件夹中运行“ yarn run ios”时,我已经在XCode和终端中打开了我的React Native项目,出现错误“ 错误:在Function找不到模块'@ babel / runtime / helpers / interopRequireDefault' .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. 

Does anybody have an idea how to solve this? 有人知道如何解决这个问题吗?

我通过运行解决了它:

yarn add @babel/runtime

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

相关问题 错误 build react native ios use yarn ios new project - Error build react native ios use yarn ios new project React Native错误:找不到模块“ jest-serializer” - React Native error: Cannot find module 'jest-serializer' react-native 与现有本机项目的集成出现错误找不到模块'react-native/cli' - react-native integration with existing native project getting error Cannot find module 'react-native/cli' 在使用 React Native 的 IOS 运行时出现“未处理的 JS 异常:本机模块不能为空”错误 - Getting “Unhandled JS Exception: Native module cannot be null” Error on IOS runtime with React Native React-Native 构建成功 - 本机模块不能为空(iOS) - React-Native Build Succeeded - Native module cannot be null (iOS) React Native 错误找不到模块'metro-config/src/defaults/blacklist' - React Native Error Cannot find module 'metro-config/src/defaults/blacklist' React Native - IOS ScreenRecordingListener 本机模块错误:未设置桥 - React Native - IOS ScreenRecordingListener Native Module error: Bridge is not set 在本机模块库中找不到ios框架头文件 - can't find ios framework headers in react native module library 在 React-native 模块中找不到带有 URLForResource 的 .caf 文件 - Cannot find .caf file with URLForResource in React-native module 无法在Release Schema中运行iOS React Native应用程序 - Cannot run iOS React Native app in Release Schema
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM