错误:找不到模块“@angular-devkit/schematics"和找不到模块“@angular-devkit/schematics" [英] Error: Cannot find module '@angular-devkit/schematics' and Cannot find module '@angular-devkit/schematics'
问题描述
当我尝试生成角度材料数据表时,出现以下错误.请指导我解决此错误.
When I try to generate angular material data-table, I am getting below error. Please guide me to resolve this error.
用于生成数据表的ng命令:
ng command used for generate the data-table:
ng g @angular/material:material-table --name=data-table
在执行上述 ng 命令后,我的终端出现以下错误
after executing above ng command I am getting below error in my terminal
找不到模块'@angular-devkit/schematics'
Cannot find module '@angular-devkit/schematics'
Error: Cannot find module '@angular-devkit/schematics'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\Lenovo\my-wks\meanStackDemo\node_modules\@angular\material\schematics\ng-generate\table\index.js:10:22)
请分享您的建议或指导以解决此问题.谢谢.
Please share your suggestion or guidance to resolve this. Thanks .
节日快乐!:-)
推荐答案
当我尝试将 angular material 安装到我的项目时,我遇到了同样的错误
When I tried installing angular material to my project I got the same error like
在 angular 7 中找不到模块@angular-devkit/schematics/tasks"
Cannot find module '@angular-devkit/schematics/tasks' in angular 7
所以我做到了
npm i @angular-devkit/schematics
npm i @angular-devkit/core
它解决了问题.
这篇关于错误:找不到模块“@angular-devkit/schematics"和找不到模块“@angular-devkit/schematics"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!