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 https://rpm.nodesource.com/setup_8.x | 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:
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:
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.