gpt4 book ai didi

angular - 错误 : More than one module matches. 使用 skip-import 选项跳过将组件导入最近的模块

转载 作者:太空狗 更新时间:2023-10-29 16:44:14 26 4
gpt4 key购买 nike

当我尝试在 Angular cli 中创建组件时,它向我显示此错误。我该如何摆脱它?

Error: More than one module matches. Use skip-import option to skip importing the component into the closest module.

我使用的是 angular cli 版本:1.4.1

最佳答案

使用 --module 参数指定模块。例如,如果主模块是 app.module.ts,运行这个:

ng g c new-component --module app

或者如果你在其他目录下

ng g c component-name --module ../

关于angular - 错误 : More than one module matches. 使用 skip-import 选项跳过将组件导入最近的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46174863/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com