I created a new project with Angular CLI 1.6.5 and when generating a component it sends me the following error: 'Error: More than one module matches. Use skip-import option to skip importing the component into the closest module. More than one module matches. Use skip-import option to skip importing the component into the closest module.' Some help?
You have multiple NgModule in the same directory. You can either skip the importation part of the generation by using --skip-import, or you can specify which one to use using the --module= followed by the path to the module you want to import the component.
Error: More than one module matches. Use skip-import option to skip importing th
e component into the closest module.
More than one module matches. Use skip-import option to skip importing the compo
nent into the closest module.
Insert component in to specific module
ng generate component
e.g ng generate component test --module app
ng g c name --skip-import
I fixed adding "src" to root config, that it was empty,
angular.json
"projectname-e2e": {
"root": "src",
"sourceRoot": "e2e",
}
I am getting error, could you please help me.
PS D:\I-AAA\Projects\Giribabu\IAAAtech\Projects\New folder\web_cc_purchased\src\app> ng g component giri-ui
Your global Angular CLI version (7.3.0) is greater than your local
version (7.0.6). The local Angular CLI version is used.
To disable this warning use "ng config -g cli.warnings.versionMismatch false".
Two or more projects are using identical roots. Unable to determine project using current working directory. Using default workspace project instead.
More than one module matches. Use skip-import option to skip importing the component into the closest module.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
You have multiple
NgModulein the same directory. You can either skip the importation part of the generation by using--skip-import, or you can specify which one to use using the--module=followed by the path to the module you want to import the component.