急速模块图中不存在模块`@ babel / runtime / helpers / interopRequireDefault`

Vij*_*dar 1 android ios react-native npm-install

我开始学习对本机作出反应,当我成功运行我的项目构建但打开应用程序并遇到此错误时,我得到了

我必须运行我的react native示例项目,例如react-native init AwesomeProject

cd AwesomeProject

npm insatll

react-native运行Android

而得到这个errorerror:捆绑失败:错误:无法解析模块@babel/runtime/helpers/interopRequireDefault/Users/macbookpro/AwesomeProject/index.js:模块 @babel/runtime/helpers/interopRequireDefault不会在急速模块map`存在

在完成所有操作之前,我将通过此链接进行本机设置

https://facebook.github.io/react-native/docs/getting-started.html

我正在使用macOS High Sierra 10.13.6

我将不胜感激任何帮助!

M_S*_*S_N 5

该问题可以通过使用解决

npm add @babel/runtime
npm install
Run Code Online (Sandbox Code Playgroud)

要么

yarn add @babel/runtime
Run Code Online (Sandbox Code Playgroud)

该问题目前仍处于打开状态,希望可以在新版本中解决。现在,您可以将babel / runtime保留在devDependencies中,但是如果要使用此版本的react-native构建发行版本,则需要将@ babel / runtime置于依赖项中。

这是更多详细信息的链接