Angular CLI: 6.0.8
Node: 10.4.0
OS: linux x64
Angular: 6.0.4
In case there is a feature module (e.g. manager.module.ts inside the e.g. "/manager" sub-folder) with the routing module externalized into the separate NgModule (e.g. manager-routing.module.ts) the error message:
More than one module matches. Use skip-import option to skip importing the component into the closest module.
does not appear and the component is properly generated and added to the manager.module.ts module.
BUT BE CAREFUL the naming convention! the name of the routing module must terminate with "-routing"!
If the routing module is given a name like e.g. manager-router.module.ts, CLI will complain with the error message and expect you to provide --module option to automatically add the component import:
ng generate component some-name --module=manager.module.ts
or
ng generate component some-name --skip-import
if you prefer to add the import of the component manually