`ng add @ionic/angular` fails for an Angular 8 app

I have an Angular 8 app and I want to add Ionic to it.

ng add @ionic/angular gives me error: Cannot read properties of undefined (reading 'options').

The only change that is saved is the adding of "@ionic/angular": "^5.9.4", to the package.json file.

Note that I run ng add @ionic/angular against a test project generated with ng new --minimal using Angular CLI 8.3.29. If the latest Angular CLI is used (14.0.2) for scaffolding, ng add @ionic/angular works fine.

I’m absolutely new to Ionic. Do I miss something?

PS: The OS is Windows 10.

Try ionic init after ng add command.

See Converting Angular Web Application into Ionic App | by Prathibha Perera | Level Up Coding

Thanks for the reply but ionic init can’t solve the problem. It just creates an ionic.config.json file in the current directory.

As described in the article from your link, ng add @ionic/angular have to update package.json, angular.json, app.module.ts and also to add the needed CSS styles. But in my case it fails.