gpt4 book ai didi

angular-material - ng 生成 @angular/material :material-nav --name=main-nav is not working

转载 作者:行者123 更新时间:2023-12-05 03:05:21 24 4
gpt4 key购买 nike

我确实有角度 6,尽管 ng generate @angular/material:material-nav --name home不工作

得到类似的错误 Collection "@angular/material" cannot be resolved.
Error: Collection "@angular/material" cannot be resolved.
at NodeModulesEngineHost._resolveCollectionPath (/Users/mac/angular/retroAngular/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js:88:15)
at NodeModulesEngineHost.createCollectionDescription (/Users/mac/angular/retroAngular/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js:106:27)
at SchematicEngine._createCollectionDescription (/Users/mac/angular/retroAngular/node_modules/@angular-devkit/schematics/src/engine/engine.js:78:40)
at SchematicEngine.createCollection (/Users/mac/angular/retroAngular/node_modules/@angular-devkit/schematics/src/engine/engine.js:71:43)
at Object.getCollection (/Users/mac/angular/retroAngular/node_modules/@angular/cli/utilities/schematics.js:28:31)
at GenerateCommand.getOptions (/Users/mac/angular/retroAngular/node_modules/@angular/cli/models/schematic-command.js:193:41)
at GenerateCommand.<anonymous> (/Users/mac/angular/retroAngular/node_modules/@angular/cli/commands/generate.js:38:53)
at Generator.next (<anonymous>)
at /Users/mac/angular/retroAngular/node_modules/@angular/cli/commands/generate.js:7:71
at new Promise (<anonymous>)

最佳答案

这是因为您还没有将@angular/material 添加到您的节点模块。先使用ng add @angular/material安装@angular/material,然后尝试生成组件

关于angular-material - ng 生成 @angular/material :material-nav --name=main-nav is not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51080683/

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