确保你的ubuntu安装了依赖包和 python,gcc,g++组件以及可选的git组件,部分可能会在更新源中已经安装。如果没有则要重新安装,命令如下:
$ sudo apt-get install g++ curl libssl-dev apache2-utils
$ sudo apt-get install python
$ sudo apt-get install build-essential
$ sudo apt-get install gcc
$ sudo apt-get install g++
从nodeJS官网 http://nodejs.org/ 下载最新源代码包
$ wget http://nodejs.org/dist/v0.10.14.tar.gz
$ tar -zxf node-v0.10.14.tar.gz
$ cd node-v0.10.14
$ ./configure
$ make
$ sudo make install
//选择目录安装(将nodejs安装在/usr/local/node目录下)
$ ./configure –prefix=/usr/local/node
$ make
$ sudo make install
安装ant
$ sudo apt-get install ant
>export ANT_HOME=/opt/apache-ant-1.8.2
>export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
>export PATH=$JAVA_HOME/bin:$PATH:$ANT_HOME/bin
>export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
安装Android SDK
$ sudo apt-get install -y libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1
$ sudo apt-get install openjdk-7-jdk
$ cd ~/Downloads/
$ wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz
$ tar -zxvf android-sdk_r23.0.2-linux.tgz
$ echo 'export ANDROID_HOME="'$HOME'/Downloads/android-sdk-linux"' >> ~/.bashrc
$ echo 'export PATH="$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform- tools"' >> ~/.bashrc
$ echo 'export JAVA_CMD="/usr/lib/jvm/java-7-openjdk-amd64/bin/java"' >> ~/.bashrc
安装cordova
$ sudo npm install -g cordova
更新cordova
$ sudo npm update cordova -g