com.facebook.react.common.javascriptexception未捕获的referenceerror:未定义regeneratorruntime

时间:2018-05-16 11:00:27

标签: react-native

我可以在ios上运行该应用,但是当尝试在android上运行时,我收到此错误消息!我该怎么解决? 我试过./gradlew clean但没有发生任何事!而且我的代码一直运行到昨天。它有一般的解决方案吗?

 Environment:
  OS: macOS High Sierra 10.13
  Node: 8.9.4
  Yarn: 1.5.1
  npm: 6.0.0
  Watchman: 4.9.0
  Xcode: Xcode 9.2 Build version 9C40b
  Android Studio: 3.1 AI-173.4720617

Packages: (wanted => installed)
  react: 16.0.0 => 16.0.0
  react-native: 0.54.2 => 0.54.2

enter image description here

2 个答案:

答案 0 :(得分:0)

导入babel-polyfill

点击以下内容以供参考,这可能会解决您的问题

https://github.com/babel/babel-preset-env/issues/112

Can you try deleting your android, ios and node modules folder and run the following

1.> npm install // to get dependecies loaded
2.> react-native upgrade // to create ios and android folder
3.> react-native link // to link the libraries
4.> react-native run-android

答案 1 :(得分:-1)

  1. 关闭地铁打包机
  2. 转到项目的根目录
  3. 运行npm start