报错: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. – 每天进步一点点

用angualr的ng 指令创建组件时,执行下面命令时

出现以下报错

ng g c report
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.

出现此问题是此项目中有多个以.module.ts的文件存在,创建时无法确定将组件导入那个module中,因此要通过–module来指定。

ng g c report --module=xxxx

其中xxxx是 .module.ts去掉的名称。

posted on   longkui  阅读(1)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示