Cordova resoursce generate fails because of unexpected token funcion

Hi there. This is my first time posting here so excuse me for any mistakes I make. I am working on a legacy project in ionic v3. I haven’t had much problems with it until today when I tried to run “ionic cordova platform add android”. It fails to generate resources with “ionic cordova resources android”. The error is as follows:

[cordova-res] async function CordovaRes(options = {}) {
[cordova-res] ^^^^^^^^
[cordova-res]
[cordova-res] SyntaxError: Unexpected token function
[cordova-res] at createScript (vm.js:56:10)
[cordova-res] at Object.runInThisContext (vm.js:97:10)
[cordova-res] at Module._compile (module.js:549:28)
[cordova-res] at Object.Module._extensions…js (module.js:586:10)
[cordova-res] at Module.load (module.js:494:32)
[cordova-res] at tryModuleLoad (module.js:453:12)
[cordova-res] at Function.Module._load (module.js:445:3)
[cordova-res] at Module.require (module.js:504:17)
[cordova-res] at require (internal/module.js:20:19)
[cordova-res] at Object. (C:\Users\abe\AppData\Roaming\npm\node_modules\cordova-res\bin\cordova-res:11:1)
[ERROR] An error occurred while running subprocess cordova-res.

I understand that this could be a problem with node not recognising the async keyword but I am running the latest version of node and npm. My ionic info is:

Ionic:

** Ionic CLI : 5.4.16**
** Ionic Framework : ionic-angular 3.6.0**
** @ionic/app-scripts : 2.1.4**

Cordova:

** Cordova CLI : 9.0.0 (cordova-lib@9.0.1)**
** Cordova Platforms : none**
** Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.1, (and 12 other plugins)**

Utility:

** cordova-res : not installed**
** native-run : not installed**

System:

** Android SDK Tools : 26.1.1 (C:\Users\abe\AppData\Local\Android\Sdk)**
** NodeJS : v16.4.0 (C:\Program Files\nodejs\node.exe)**
** npm : 7.18.1**
** OS : Windows 10**

I also see that it says that cordova-res is not installed, but it is installed. If i run cordova-res -v I get 0.15.3. I have tried everything to get this working but so far no luck. If anyone has any ideas I would be very greatful.