Angular More than one module matches adding component

Error while add anew new component via ng g c YourComponent command.

More than one module matches. Use the '--skip-import' option to skip 
importing the component into the closest module or use the module 
option to specify a module.

The solution is to specify –module parameter in the ng generate command and specify the exact module to which you want to add the component. Below is the full command to do the same:

ng g c YourComponent --module Shared 

Above the component is being added to SharedModule. You can change the name of module based on where you want to added the component.