Angular7创建组件提示 错误 Use skip-import option to skip importing the component into the closest module.

发布于 5 年前 作者 gougou168 2731 次浏览 最后一次编辑是 5 年前 来自 分享

Angular7创建组件的时候提示如下错误。 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.

解决办法:

ng g c newslist  --module=app

原因:

项目中有多个模块(包含appModule , routingModule等),

所以需要选中要配置的app模块

回到顶部