Trying to update to iOS 5, get errors in build

Was trying to build my old way and got error.

(node:1923) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘toLowerCase’ of undefined

I need to updated my iOS to 5 or 5.1. As I’m adding this platform ionic tries to install all my plugins. Getting these errors.

Installing “cordova-plugin-device” for ios
Failed to install ‘cordova-plugin-device’: Error: Cannot find module ‘glob’

Installing “cordova-plugin-whitelist” for ios
Failed to install ‘cordova-plugin-whitelist’: Error: Cannot find module ‘./src/superspawn’

Tried ionic cordova prepare ios similar errors installing plugins.

I think I need to upgrade some other items. I’m still kind of stuck on Ionic 3. Here is my ionic info.
Again I have just tried to add iOS 5.1 has build problems was on ionic iOS 4.5.5.

What should I try next?

cli packages: (/Users/dev/.npm-packages/lib/node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 8.0.0 

local packages:

@ionic/app-scripts : 3.2.4
Cordova Platforms  : ios 5.1.1
Ionic Framework    : ionic-angular 3.9.2

System:

ios-deploy : 1.9.2 
Node       : v8.10.0
npm        : 5.8.0 
OS         : macOS
Xcode      : Xcode 11.3.1 Build version 11C504 

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : pro

Updated the ionic cli but still getting an error.
Updated to 5.4.16.

iOS project created with cordova-ios@5.1.1
Discovered plugin “cordova-plugin-device” in config.xml. Adding it to the project
Installing “cordova-plugin-device” for ios
Failed to install ‘cordova-plugin-device’: Error: Cannot find module ‘glob’

Updated npm to 6.14.2
I do an npm install which sets up the node_module folder up for my app.
Then do an ionic cordova remove platform ios
ionic cordova add platform add ios@5 (something like this).

Trying to set up all the plugins, seems like each plugin fails either for superspawn or glob. What is next?

Try to add "types": [] to tsconfig.json in "compilerOptions", and use @app-scrips@3.2.3 version.