有时使用angular 如下命令创建组件的时候报错如下:
ng generate component dashboard2
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 generate component dashboard --module=app.module
本文介绍了一个在使用Angular命令行工具创建组件时遇到的错误及其解决办法。当尝试创建名为dashboard2的组件时,由于匹配到多个模块而报错。文章提供了解决方案,即通过指定模块参数来避免错误。

965

被折叠的 条评论
为什么被折叠?



