弹出显示错误后,对本地应用程序或EXPO做出反应,使其无法在虚拟设备上运行

时间:2019-01-28 07:52:26

标签: javascript react-native ecmascript-6 expo

项目在Expo移动设备上运行,但在android模拟器上运行 所以我已经在命令下面运行

npm run eject 

expo eject

它向我显示了以下错误,我尝试了所有可能的方法,甚至更新了 babel预设,react-native-scripts为2。 但这不起作用

> react-native run-android

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> (D:\rcf\AwesomeProject\node_modules\react-native\local
-cli\cliEntry.js:11:41)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Module._compile (D:\rcf\AwesomeProject\node_modules\pirates\lib\index.js:
83:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.newLoader [as .js] (D:\rcf\AwesomeProject\node_modules\pirates\lib
\index.js:88:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ android: `react-native run-android`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ android script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

enter image description here

1 个答案:

答案 0 :(得分:0)

尝试安装这两个依赖项:

npm install --save-dev @babel/core
npm install --save-dev @babel/runtime