More than one module matches. Use skip-import option to skip importing the component into the closest module code example

Example 1: More than one module matches. Use skip-import option to skip importing the component into the closest module.

ng g c new-component --module app

Example 2: skip import angular 6

ng g component component-name --skip-import

Example 3: More than one module matches

Specify the module using the --module parameter. 
For example, if the main module is app.module.ts, run this:

ng g c new-component --module app
Or if you are in an other directory then

ng g c component-name --module ../

Example 4: More than one module matches. Use skip-import option to skip importing the component into the closest module. into the closest module.

ng g c new-component --module app
//Or if you are in an other directory then
ng g c component-name --module ../

Example 5: ng g more than one module matches

ng g c new-component --module app

Example 6: npm generate component component name command skip-import

ng g c componentName --module app (if your module is app)

Tags:

Misc Example