react-native -v
给了我这个:
react-native-cli: 2.0.1 react-native: 0.57.1
当我运行任何其他命令,例如react-native info
或react-native run-android
时,总是出现以下错误消息:
function getCliConfig(){var cliArgs,config,expoAssetPluginPath;return regeneratorRuntime.async(function getCliConfig$(_context){while(1){switch(_context.prev=_context.next){case 0: ^ ReferenceError: regeneratorRuntime is not defined at getCliConfig (/Applications/MAMP/htdocs/juices/node_modules/react-native/local-cli/core/index.js:128:64) at Object.<anonymous> (/Applications/MAMP/htdocs/juices/node_modules/react-native/local-cli/core/index.js:181:30) at Module._compile (internal/modules/cjs/loader.js:654:30) at Module._compile (/Applications/MAMP/htdocs/juices/node_modules/pirates/lib/index.js:83:24) at Module._extensions..js (internal/modules/cjs/loader.js:665:10) at Object.newLoader [as .js] (/Applications/MAMP/htdocs/juices/node_modules/pirates/lib/index.js:88:7) at Module.load (internal/modules/cjs/loader.js:566:32) at tryModuleLoad (internal/modules/cjs/loader.js:506:12) at Function.Module._load (internal/modules/cjs/loader.js:498:3) at Module.require (internal/modules/cjs/loader.js:598:17)
答案 0 :(得分:0)
实际上,此问题与本机版本有关,目前,Expo支持的版本为0.55.4。请降级react-native版本,然后重试,希望它能工作。
Expo文档(支持的版本):- https://docs.expo.io/versions/latest/sdk/#sdk-version
尝试此操作以降级您的本机版本:-
npm install react-native@0.55.4