gpt4 book ai didi

Angular CLI 和 Angular Material(原理图)错误 : Collection "@angular/material" cannot be resolved

转载 作者:太空狗 更新时间:2023-10-29 16:59:11 25 4
gpt4 key购买 nike

我正在尝试使用 this page. 上显示的 Angular 模式当我尝试在项目根目录下的终端中使用以下命令时 ng generate @angular/material:material-nav --name name-of-new-nav,出现以下错误红色的,

Collection "@angular/material" cannot be resolved. Error: Collection "@angular/material" cannot be resolved. at NodeModulesEngineHost._resolveCollectionPath (/Users/jeremypeters/MEGA/development/learning/angular/material-learn/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js:88:15) at NodeModulesEngineHost.createCollectionDescription (/Users/jeremypeters/MEGA/development/learning/angular/material-learn/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js:106:27) at SchematicEngine._createCollectionDescription (/Users/jeremypeters/MEGA/development/learning/angular/material-learn/node_modules/@angular-devkit/schematics/src/engine/engine.js:78:40) at SchematicEngine.createCollection (/Users/jeremypeters/MEGA/development/learning/angular/material-learn/node_modules/@angular-devkit/schematics/src/engine/engine.js:71:43) at Object.getCollection (/Users/jeremypeters/MEGA/development/learning/angular/material-learn/node_modules/@angular/cli/utilities/schematics.js:28:31) at GenerateCommand.getOptions (/Users/jeremypeters/MEGA/development/learning/angular/material-learn/node_modules/@angular/cli/models/schematic-command.js:193:41) at GenerateCommand. (/Users/jeremypeters/MEGA/development/learning/angular/material-learn/node_modules/@angular/cli/commands/generate.js:38:53) at Generator.next () at /Users/jeremypeters/MEGA/development/learning/angular/material-learn/node_modules/@angular/cli/commands/generate.js:7:71 at new Promise ()

我如何让它工作?

信息:Angular CLI:6.0.8

最佳答案

好像坏了,临时解决方案,使用以下版本

ng add @angular/material@6.2.1

关于Angular CLI 和 Angular Material(原理图)错误 : Collection "@angular/material" cannot be resolved,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51003953/

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