Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 生成Android应用程序时获取React Native的错误_React Native - Fatal编程技术网

React native 生成Android应用程序时获取React Native的错误

React native 生成Android应用程序时获取React Native的错误,react-native,React Native,我在构建Android应用程序时遇到以下错误。有人能解释为什么会这样吗 import type {CommandT} from './commands'; ^^^^ SyntaxError: Unexpected identifier at new Script (vm.js:74:7) at createScript (vm.js:246:10) at Object.runInThisContext (vm.js:298:10) at M

我在构建Android应用程序时遇到以下错误。有人能解释为什么会这样吗

    import type {CommandT} from './commands';
       ^^^^

SyntaxError: Unexpected identifier
    at new Script (vm.js:74:7)
    at createScript (vm.js:246:10)
    at Object.runInThisContext (vm.js:298:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Module._compile (E:\React_Project\OneTap\node_modules\pirates\lib\index.js:91:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.newLoader [as .js] (E:\React_Project\OneTap\node_modules\pirates\lib\index.js:96:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! OneTap@0.0.1 start: `node node_modules/react-native/local-cli/cli.js start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the OneTap@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

基于此,看起来这是一个与Windows中的RN 0.56相关的问题。作为一种解决方法,我建议使用0.55.4版。

我使用React原生init{proj_name}--version React构建React项目-native@0.55.4当我运行npm start it时创建的项目给了我相同的错误OK我知道为什么我会面临这个问题,因为当我使用react native init{proj_name}构建项目时--版本反应-native@0.55.4我曾经启动npm audit和npm audit修复程序来关闭导致我抛出上述错误的漏洞。没有修复,我可以建立项目。谢谢