初始化新的本机项目时出错

时间:2019-07-31 17:46:28

标签: react-native react-native-android

我正在尝试创建我的第一个项目,但是一直遇到这个问题。

  

C:\ Users \ xxxx \ AndroidStudioProjects> react-native init AwesomeProject       这将引导您在C:\ Users \ xxxx \ AndroidStudioProjects \ AwesomeProjectInstalling react-native中创建一个新的React Native项目。       考虑安装纱线以加快速度:https://yarnpkg.com       {错误:spawnSync C:\ WINDOWS \ system32 \ cmd.exe; C:\ Users \ xxxx \ AppData \ Local \ Android \ Sdk \ platform-tools ENOENT           在Object.spawnSync(内部/child_process.js:1002:20)           在spawnSync(child_process.js:614:24)           在execSync(child_process.js:661:13)           在运行时(C:\ Users \ xxxx \ AppData \ Roaming \ npm \ node_modules \ react-native-cli \ index.js:294:5)           在createProject(C:\ Users \ xxxx \ AppData \ Roaming \ npm \ node_modules \ react-native-cli \ index.js:249:3)           在初始化时(C:\ Users \ xxxx \ AppData \ Roaming \ npm \ node_modules \ react-native-cli \ index.js:200:5)           在对象。 (C:\ Users \ xxxx \ AppData \ Roaming \ npm \ node_modules \ react-native-cli \ index.js:153:7)           在Module._compile(内部/模块/cjs/loader.js:776:30)           在Object.Module._extensions..js(内部/模块/cjs/loader.js:787:10)           在Module.load(internal / modules / cjs / loader.js:653:32)         errno:“ ENOENT”,         代码:“ ENOENT”,         系统调用:          'spawnSync C:\ WINDOWS \ system32 \ cmd.exe; C:\ Users \ xxxx \ AppData \ Local \ Android \ Sdk \ platform-tools',         路径:          'C:\ WINDOWS \ system32 \ cmd.exe; C:\ Users \ xxxx \ AppData \ Local \ Android \ Sdk \ platform-tools',         spawnargs:          ['/ d',            '/ s',            '/C',            '“ npm install --save --save-exact react-native”'],         错误:[循环],         状态:null,         信号:空,         输出:null,         pid:0,         标准输出:null,         stderr:null}       命令npm install --save --save-exact react-native失败。

Windows 10 64位 用户变量

ANDROID_HOME C:\Users\xxxx\AppData\Local\Android\Sdk 
path C:\Users\xxxx\AppData\Local\Android\Sdk\platform-tools

0 个答案:

没有答案