错误:多个模块匹配.使用skip-import选项跳过将组件导入到最近的模块中的步骤 [英] Error: More than one module matches. Use skip-import option to skip importing the component into the closest module

查看:1739
本文介绍了错误:多个模块匹配.使用skip-import选项跳过将组件导入到最近的模块中的步骤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在角度cli中创建组件时,它向我显示了此错误.我如何摆脱它?

When I try to create a component in the angular cli, it's showing me this error. How do I get rid of it ?

错误:多个模块匹配.使用skip-import选项可以跳过将组件导入到最近的模块中的过程.

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

我正在使用angular cli版本:1.4.1

I'm using angular cli version: 1.4.1

推荐答案

使用--module参数指定模块. 例如,如果主模块是app.module.ts,请运行以下命令:

Specify the module using the --module parameter. For example, if the main module is app.module.ts, run this:

ng g c new-component --module app

或者如果您在其他目录中,则

Or if you are in an other directory then

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

这篇关于错误:多个模块匹配.使用skip-import选项跳过将组件导入到最近的模块中的步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆