Ionic build events.js 85未处理的错误事件

时间:2015-04-17 23:35:02

标签: android windows sdk npm ionic

我正在尝试构建一个离子项目,但错误会弹出。我已经设置了所有环境变量。像node,npm,bower,ionic这样的东西都在工作,SDK用API 22更新

E:\io1\apa>ionic build android

running cordova build android
Running command: "C:\Program Files\nodejs\node.exe" E:\io1\apa\hooks\after_prepa
re\010_add_platform_class.js E:\io1\apa
add to body class: platform-android
Running command: E:\io1\apa\platforms\android\cordova\build.bat
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: spawn cmd ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
    at child_process.js:1144:20
    at process._tickCallback (node.js:355:11)
ERROR building one of the platforms: Error: E:\io1\apa\platforms\android\cordova
\build.bat: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: E:\io1\apa\platforms\android\cordova\build.bat: Command failed with exit
code 1
    at ChildProcess.whenDone (C:\Users\Nitish\AppData\Roaming\npm\node_modules\c
ordova\node_modules\cordova-lib\src\cordova\superspawn.js:131:23)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

1 个答案:

答案 0 :(得分:2)

请参阅此网站:http://ionicframework.com/docs/guide/installation.html

遵循每一步。对于Windows和Windows,有不同的命令/步骤。 IOS平台。 确保已使用cmd中的“npm install -g cordova ionic gulp”命令安装了nodejs以及ionic,cordova和gulp。

确保您已在同一驱动器中安装了上述所有组件,最新的Android SDK,例如C:\ ..以避免并发症。

正确设置上面链接中提到的PATH,JAVA_HOME,ANDROID_HOME等环境变量。使用最新的JDK。

希望这可能会有所帮助。