Could not find an NgModule. Use the skip-import option to skip importing in NgModule.


使用  ng generate component sticky-table  命令新建一个组件时报错:Could not find an NgModule. Use the skip-import option to skip importing in NgModule.

 

原因是无法找到上级模块的 module(module 的名字不是 app.module.ts);

 

解决办法:指定 module 即可, ng generate component sticky-table --module=main ,我这里 module 的名字是 main.ts。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM