离子应用程序框架在Centos服务器中安装
我正在尝试在centos服务器上构build离子项目。 而在centos服务器中build立离子,我得到下面的错误。
[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 nodejs
-
npm install -g cordova ionic
-
ionic start todo blank
-
cd todo && ls
-
ionic platform add android
-
ionic build android
(在Centos的Linux服务器获取错误)
对于这些步骤,我已经粘贴了上述错误。
您必须安装Android SDK并添加ANDROID_HOME
环境variables。
从spring.io开始的步骤:
- 从Android网站下载适用于您的操作系统的正确版本的Android SDK。
- 将存档解压缩到您select的位置。 例如,在Linux或Mac上,可以将其放置在用户目录的根目录下。 请参阅Android开发者网站了解更多安装细节。
-
根据Android SDK的位置configuration
ANDROID_HOME
环境variables。 另外,考虑将ANDROID_HOME/tools
和ANDROID_HOME/platform-tools
到PATH中。export ANDROID_HOME=/<installation location>/android-sdk-linux export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Android SDK下载不包括特定的Android平台。 要运行本指南中的代码,您需要下载并安装最新的SDK平台。 您可以通过使用上一节安装的Android SDK和AVD Manager来完成此操作。
-
打开Android SDKpipe理器窗口:
android
注意 :如果这个命令没有打开Android SDKpipe理器 ,那么你的pathconfiguration不正确。
-
select工具checkbox。
- select最新的Android SDKcheckbox。
- 从Extras文件夹中selectAndroid支持库的checkbox。
-
点击Install packages …button完成下载和安装。
注意 :您可能希望安装所有可用的更新,但请注意,这需要更长的时间,因为每个API级别都是大量下载。