Facebook X (Twitter) Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook X (Twitter) Instagram
    TecAdmin
    You are at:Home»Programming»Nodejs»How to Install and Use Cordova on CentOS/RHEL 7/6/5

    How to Install and Use Cordova on CentOS/RHEL 7/6/5

    By RahulSeptember 10, 20192 Mins Read

    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 platforms’ native development language. Apache Cordova command-line requires Node.js to run and available on NPM.

    • 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.

    sudo yum install -y gcc-c++ make
    curl -sL https://rpm.nodesource.com/setup_12.x | sudo -E bash -
    

    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.

    sudo npm install -g cordova
    

    Step 3 – Check Cordova Version

    After successful installation of Cordova on your system, Use the following command to check Cordova version.

    cordova --version
    
    8.0.0
    

    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.

    cordova create myapp
    

    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.

    cordova platform add ios
    cordova platform add android
    

    Use below command to list the installed and available platforms for Cordova application.

    cordova platform -ls 
    
    Installed platforms:
      android 7.0.0
      ios 4.5.4
    Available platforms:
      browser ~5.0.1
      osx ~4.0.1
      windows ~5.0.0
      www ^3.12.0
    

    If you accidentally added any platform which you no longer needs, just remove that using commands like below.

    cordova platform remove ios
    cordova platform remove android
    

    Step 5 – Build Cordova Application

    Before building a Cordova application, 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 
    

    cordova node
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    A Practical Guide for Reading ‘.env’ Files in Node.js

    Setting Up Angular on Ubuntu: Step-by-Step Guide

    How to Install NVM on CentOS Stream 9 & RHEL 9

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Using .env Files in Django
    • Using .env File in FastAPI
    • Setting Up Email Notifications for Django Error Reporting
    • How to Enable Apache Rewrite (mod_rewrite) Module
    • What are Microservices?
    Facebook X (Twitter) Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.