Cordova Installation in ubuntu Category : Cordova Tutorials | Updated at : 2019-02-15 01:29:40

Apache Cordova helps to create Mobile applications with HTML, CSS and JS. This tutorial shows how to install cordova and its dependency applications.Cordova and PhoneGap are usually installed using node packages. So need to install both nodejs and npm (node package manager), ant cordova and android sdk. ant helps to run app in local server. cordova helps to develop and render app in multiple platforms. android studio helps build apk.


Step 1 : Install nodejs and npm

Cordova and PhoneGap are usually installed using node packages. So if you don't have it yet, you need to install both nodejs and npm (node package manager).

Check nodejs already installed
 

nodejs -v
node -v

If node js is not installed in your system. following cmd helps to install npm in ubuntu

$ sudo apt-get install nodejs npm


After installation , verify installation by cgecking version
 

npm -version
nodejs -v

--- if NOT work-- add PPA-------
 

$ sudo apt-get install python-software-properties python g++ make
$ sudo add-apt-repository ppa:chris-lea/node.js
$ sudo apt-get update

On recent versions of nodejs, the alias node is not created. And if you try to use it right now, the system will tell you to install the package called node. So we will make that alias ourselves.

$ sudo ln -s /usr/bin/nodejs /usr/bin/node
node -v

Step 2 : Install ant

That is probably the hardest thing you will have to do today.

Check ant is already installed
 

ant -version

Cmd to install ant
 

$ sudo apt-get install ant
ant -version

Step 3 : Install Cordova

Now that npm and node are installed, installing Cordova and PhoneGap is really easy.

$ sudo npm install -g cordova
cordova -version
cordova -v