How to resolve BABEL error when installing geolocation in ionic app

I have the same problem, i seems a bug in the last version of babel.
i fixed following this comment workaround

  1. delete node_modules and package-lock.json
  2. add “resolutions”: { “@babel/preset-env”: “^7.8.7” }, to package.json
    a88242a182157c0aa05069068efc1041
  3. npm install npm-force-resolutions --save-dev
  4. npm install
  5. npx npm-force-resolutions
  6. npm install again
  7. then run your app(ionic cordova run android in my case)
3 Likes