我正试图在centos服务器上构建离子项目。在centos服务器中构建离子型服务器时,我会得到以下错误。
[root@localhost todo]# ionic build android
Native thread-sleep not available.
This will result in much slower performance, but it will still work.
You should re-install spawn-sync or upgrade to the lastest version of node if possible.
Check /usr/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cross-spawn/node_modules/spawn-sync/error.log for more details
Running command: /root/todo/hooks/after_prepare/010_add_platform_class.js /root/todo
add to body class: platform-android
Running command: /root/todo/platforms/android/cordova/build
[Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.]
ERROR building one of the platforms: Error: /root/todo/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /root/todo/platforms/android/cordova/build: Command failed with exit code 2
[root@localhost todo]# npm -v
1.3.6
[root@localhost todo]# cordova -v
5.4.1
[root@localhost todo]# ionic -v
1.7.12我成功地为centos服务器安装了所有软件包。
[root@localhost todo]# uname -a
Linux localhost.localdomain 2.6.32-504.el6.i686 #1 SMP Wed Oct 15 03:02:07 UTC 2014 i686 i686 i386 GNU/Linux我使用了以下步骤。
yum install nodejsnpm install -g cordova ionicionic start todo blankcd todo && lsionic platform add androidionic build android (在centos服务器中获取错误)对于这些步骤,我已经粘贴了上面的错误。
发布于 2015-12-28 10:57:54
您必须安装Android并添加ANDROID_HOME环境变量。
来自spring.io的步骤
ANDROID_HOME环境变量。另外,考虑将ANDROID_HOME/tools和ANDROID_HOME/platform-tools添加到您的路径中。
导出android_HOME=//导出PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-toolsAndroid下载不包括特定的Android平台。要运行本指南中的代码,您需要下载并安装最新的SDK平台。您可以使用安装在上一节中的Android和AVD管理器来完成此操作。
https://stackoverflow.com/questions/34488517
复制相似问题