Search code examples
angularionic-frameworkcommand-line-interface

Error: Unknown argument: standalone when trying to generate standalone Angular component with the Ionic CLI


When I try to generate a standalone component using the Ionic CLI, I get the following error:

$ ionic g c someComponent --standalone
> ng generate component someComponent --standalone --project=app
Error: Unknown argument: standalone

I'm using:

"@angular/core": "^17.0.8",
"@ionic/angular": "^7.7.3",
...
"@ionic/angular-toolkit": "^9.0.0",
"@ionic/cli": "^6.20.9",

Solution

  • Turns out it was a problem with my @ionic/angular-toolkit version. After upgrading to "@ionic/angular-toolkit": "^11.0.1" it works just fine.