创建新组件时出现 Angular 6 CLI 错误

Sli*_*Deb -1 angular

我在尝试创建新组件时遇到问题。

错误是:

不止一个模块匹配。使用跳过导入选项跳过将组件导入最近的模块

为什么我收到这个错误?

Ank*_*rma 6

尝试通过显式声明要导入它的模块来生成组件。

例如,

ng g component my-component --module <module_name>
Run Code Online (Sandbox Code Playgroud)

  • 谢谢我的亲!这个命令对我有用:“ng g component my-component --module app” (2认同)