Angular Error: A collection and schematic is required during execution

Error while adding a new component in Angular:

Error: A collection and schematic is required during execution.

The issue could be because of a missing component argument in ng g command, example:

ng g YourComponent

The solution is to add c as a component argument in your command:

ng g c YourComponent