Adding cordova-plugin-inappbrowser results in failed builds for iOS and Android

After adding cordova-plugin-inappbrowser, I fail to build my app for iOS and Android. This is the resulting message:

   While removing plugins                     
   cordova-plugin-compat,cordova-plugin-geolocation,cordova-plugin-meteor-webapp,cordova-plugin-splashscreen,cordova-plugin-statusbar,cordova-plugin-whitelist,cordova-plugin-wkwebview-engine
   from Cordova project:
   Cordova error: The plugin 'cordova-plugin-compat' is required by (cordova-plugin-geolocation), skipping uninstallation. (try --force if trying to update)

Perhaps related, I also have mdg:geolocation in my project.

How to resolve this?