gpt4 book ai didi

angular - 错误 : Cannot find module '@angular-devkit/schematics' and Cannot find module '@angular-devkit/schematics'

转载 作者:行者123 更新时间:2023-12-04 22:02:50 29 4
gpt4 key购买 nike

当我尝试生成 Angular Material 数据表时,出现以下错误。请指导我解决此错误。

用于生成数据表的 ng 命令:

ng g @angular/material:material-table --name=data-table

执行上述 ng 命令后,我的终端出现以下错误

找不到模块'@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)

请分享您的建议或指导以解决此问题。谢谢 。

节日快乐!:-)

最佳答案

当我尝试将 Angular Material 安装到我的项目时,我遇到了同样的错误

Cannot find module '@angular-devkit/schematics/tasks' in angular 7



所以我做了
npm i @angular-devkit/schematics
npm i @angular-devkit/core

它解决了这个问题。

关于angular - 错误 : Cannot find module '@angular-devkit/schematics' and Cannot find module '@angular-devkit/schematics' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53940350/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com