Struggling with Capacitor plugins

I am having a hard time getting key Capacitor plugins to work. Some do and other like Device or Geolocation won’t.

I am working with a mobile app.

I think the problem is that certain plugins use require (CommonJS) which throws an error when you try and run it.

I know that Node.js supports CommonJS but for some reason it is not working in my app.

Can anybody give me some advice on how to get these plugins to work?