If you’re developing with Cordova/PhoneGap/Ionic apps on the Ubuntu platform, chances are you’re using the cordova-cli package. For a while now, the nodejs and nodejs-legacy packages have collided around a singe man file. Unfortunately, the simple file collision can break the entire package manager and make it difficult to update anything. Add dkpg --force-overwrite Flag The solution is very simple. Just add the dkpg --force-overwrite flag to your apt-get commands. So this: sudo apt-get install cordova-cli becomes: sudo apt-get -o Dpkg::Options::="--force-overwrite" install cordova-cli Of course, you probably don’t want to type that all the time.
There don’t seem to be a lot of tutorials on how to set up and test Ionic, PhoneGap, or Cordova apps with native plugins in the comfort of your browser. So we’ll cover the steps necessary to get up and running here so, hopefully, you won’t lose many hours trying to figure it out as I did. We’ll assume that you’ve already met these prerequisites: Already have NPM and NodeJS installed.
When building and running apps using the Ionic Framework, it’s often very helpful to exclude certain sets of files. For me, that issue was critical to fix because including a node_modules directory in the build resulted build errors. Of course, it’s also super useful to keep the app size the smallest possible, too. Exlcluding files allows you to control completely what gets in the resulting .apk file. Thankfully, the process is quite simple.