【发布时间】:2019-04-15 00:45:07
【问题描述】:
我通过执行命令创建了一个react项目
展会初始化
(创建了一个空白项目) 我在安卓模拟器上运行了这个(效果很好)
我想退出世博会,因为我有一些自定义代码。 所以我执行了
npm 运行弹出
一切顺利,然后我执行了
react-native run-android
在安卓模拟器上打开应用
我收到以下错误
PS C:\mobileApp\one> react-native run-android C:\mobileApp\one\node_modules\react-native\local-cli\core\index.js:128 function getCliConfig(){var cliArgs,config,expoAssetPluginPath;return regeneratorRuntime.async(函数 getCliConfig$(_context){while(1){switch(_context.prev=_context.next){case 0:^
ReferenceError:regeneratorRuntime 未在 getCliConfig 中定义 (C:\mobileApp\one\node_modules\react-native\local-cli\core\index.js:128:64) 在对象。 (C:\mobileApp\one\node_modules\react-native\local-cli\core\index.js:181:30) 在 Module._compile (internal/modules/cjs/loader.js:688:30) 在 模块._compile (C:\mobileApp\one\node_modules\pirates\lib\index.js:83:24) 在 Module._extensions…js (internal/modules/cjs/loader.js:699:10) 在 Object.newLoader [as .js] (C:\mobileApp\one\node_modules\pirates\lib\index.js:88:7) 在 Module.load (internal/modules/cjs/loader.js:598:32) at tryModuleLoad (internal/modules/cjs/loader.js:537:12) 在 Function.Module._load (internal/modules/cjs/loader.js:529:3) 在 Module.require (内部/模块/cjs/loader.js:636:17) PS C:\mobileApp\one>
请帮忙
【问题讨论】:
-
您是否尝试过重启 Metro bundler?
-
像文档建议的那样,在全新的 expo init 项目中遇到同样的问题。你有没有想过如何解决这个问题?似乎最新版本无法正常工作。我想我会尝试以前的版本。
-
无法修复,开始使用 react-native-cli (npmjs.com/package/react-native-cli)
标签: reactjs react-native expo