Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Linux Tutorials»How to Install and Use Cordova on Ubuntu 18.04, 16.04 & LinuxMint 19/18

    How to Install and Use Cordova on Ubuntu 18.04, 16.04 & LinuxMint 19/18

    RahulBy RahulNovember 26, 20152 Mins ReadUpdated:September 10, 2019

    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.

    • Recommended: Setup Ionic Framework on Ubuntu, Debian, and LinuxMint for open-source SDK for hybrid mobile app development

    Step 1 – Install Node.js and NPM

    First, use the following commands to install NPM and Node.js on your system. In below commands, the first command will install some required packages on the system. The second command will add PPA for node.js to your system. After that update, your all attached PPA and last command will install Node.js and NPM on your system.

    You can visit our tutorial to install latest Node.js on Ubuntu and debian systems.

    sudo apt-get install python-software-properties
    curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
    sudo apt-get install nodejs
    

    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 the 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 
    
    Apache cordova Framework mobile framework
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow To Install Laravel Framework on Ubuntu 18.04 & 16.04
    Next Article How to Send Email from Gmail SMTP with Linux Command Line

    Related Posts

    (Resolved) userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms

    Updated:May 10, 20221 Min Read

    How to Install Apache ActiveMQ on Ubuntu 22.04

    3 Mins Read

    How To Enable SSH Server on Ubuntu 22.04

    Updated:April 22, 20222 Mins Read

    How To Install LAMP Stack on Ubuntu 22.04 LTS

    Updated:April 20, 20225 Mins Read

    How To Disable HTTP Methods in Apache

    Updated:December 31, 20212 Mins Read

    10 Best Linux Video Players in 2022

    Updated:February 18, 20226 Mins Read

    3 Comments

    1. Mojokpahit on March 17, 2021 6:55 am

      i have error when check version cordova,

      usr/local/lib/node_modules/cordova/node_modules/fs-extra/lib/mkdirs/make-dir.js:85
      } catch {
      ^

      SyntaxError: Unexpected token {
      at new Script (vm.js:51:7)
      at createScript (vm.js:136:10)
      at Object.runInThisContext (vm.js:197:10)
      at Module._compile (internal/modules/cjs/loader.js:618:28)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
      at Module.load (internal/modules/cjs/loader.js:566:32)
      at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
      at Function.Module._load (internal/modules/cjs/loader.js:498:3)
      at Module.require (internal/modules/cjs/loader.js:598:17)
      at require (internal/modules/cjs/helpers.js:11:18)

      what i have to do?

      Reply
    2. stdunbar on May 15, 2018 10:43 pm

      None of this works with 18.04 currently as there isn’t a Cordova package for “bionic”. The title is not accurate

      Reply
    3. Boris on November 28, 2017 2:22 pm

      Hi!
      Thanks for your tuto.
      I’m on Ubuntu 16.04 LTS.
      Whwn I finish and check Cordova version, I get :
      $ cordova –version —> 4.3.1
      $ sudo cordova –version —> 7.1.0
      It is less than your version. Is it normal?

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install Sublime Text 4 on Ubuntu 22.04
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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