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