How to Install Apache Cordova on CentOS 7

r00t August 1, 2018

Install Apache Cordova on CentOS 7

In this tutorial we are going to learn how to install Apache Cordova on CentOS 7. We will also install and configure its prerequisites. Apache Cordova is an open-source mobile development framework. It allows you to use standard web technologies such as HTML5, CSS3, and JavaScript for cross-platform development, avoiding each mobile platform native development language. Apache Cordova command-line requires Node.js to run and available on NPM.

I recommend to use a minimal CentOS server setup as a basis for the tutorial, that can be a virtual or a root server image with an CentOS 7 minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install Apache Cordova on CentOS 7

Step 1. First, ensure your system and apt package lists are fully up-to-date by running the following:

yum -y install epel-release
yum -y update

Step 2. Install dependencies.

In order to install Cordova, you need to install Node.js and NPM on your system:

sudo yum install -y gcc-c++ make
curl -sL | sudo -E bash -

Step 3. Installing Apache Cordova on CentOS 7.

Install Cordova with NPM:

sudo npm install -g cordova

Once successful installation of Cordova on your system, use the following command to check Cordova version:

cordova --version

Step 4. Create Application with Cordova.

Example create an application with name myapp:

cordova create myapp

Now add the required platform in your application:

cordova platform add ios
cordova platform add android

Step 5. Build Cordova Application.

First, make sure that the system fulfills all the requirements for your build environment:

cordova requirements

On all requirements completed successfully run the build command to build your application:

cordova build         ## Build all added platforms 
cordova build android ## Build for specific platform

Congratulation’s! You have successfully install Cordova on your CentOS 7 server. Thanks for using this tutorial for installing Apache Cordova on CentOS 7 system.

The Tags:

Leave a Comment

Comments are closed.