You may like: Setup Ionic Framework on CentOS for open-source SDK for hybrid mobile app development
Step 1 – Prerequsities
In order to install Cordova, you must have installed Node.js and NPM on your system. Skip this step if you already have installed but if Not, run the following commands to install it first. You can visit our tutorial to install latest Node.js on CentOS and Red Hat systems.
Step 2 – Install Cordova with NPM
Now use the following command to install Cordova on your system using npm command. It will install all other required node modules on your system.
Step 3 – Check Cordova Version
After successful installation of Cordova on your system, Use the following command to check Cordova version.
Step 4 – Create Application with Cordova
Use the Cordova command to create your Application. Execute below command to create an application with name myapp. You can change the name on yours. Now add the required platform in your application. This will create required files for the corresponding platform under the platforms/android and platforms/ios directories. Use below command to list the installed and available platforms for Cordova application. If you accidentally added any platform which you no longer needs, just remove that using commands like below.
Step 5 – Build Cordova Application
Before building a Cordova application, 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.