我正在尝试使用此页面上显示的 Angular 架构。 当我尝试在项目根目录的终端中使用以下命令ng generate @angular/material:material-nav --name name-of-new-nav时,出现以下红色错误,
无法解析集合“@angular/material”。错误:无法解析集合“@angular/material”。在 NodeModulesEngineHost._resolveCollectionPath (/Users/jeremypeters/MEGA/development/learning/angular/material-learn/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js:88:15) 在 NodeModulesEngineHost。 createCollectionDescription (/Users/jeremypeters/MEGA/development/learning/angular/material-learn/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js:106:27) 在 SchematicEngine._createCollectionDescription (/Users/jeremypeters/MEGA/development/learning/angular/material-learn/node_modules/@angular-devkit/schematics/src/engine/engine.js:78:40)在 SchematicEngine。在 Object.getCollection (/Users/jeremypeters/ MEGA/development/learning/angular/material-learn/node_modules/@angular/cli/utilities/schematics.js:28:31) 在 GenerateCommand.getOptions (/Users/jeremypeters/MEGA/development/learning/angular/material-learn /node_modules/@angular/cli/models/schematic-command.js:193:41) 在 GenerateCommand。(/Users/jeremypeters/MEGA/development/learning/angular/material-learn/node_modules/@angular/cli/commands/generate.js:38:53) 在 Generator.next () 在 /Users/jeremypeters/MEGA/development /learning/angular/material-learn/node_modules/@angular/cli/commands/generate.js:7:71 at new Promise () 在 GenerateCommand.getOptions (/Users/jeremypeters/MEGA/development/学习/角度/材料学习/node_modules/@angular/cli/models/schematic-command.js:193:41)在 GenerateCommand。(/Users/jeremypeters/MEGA/development/learning/angular/material-learn/node_modules/@angular/cli/commands/generate.js:38:53) 在 Generator.next () 在 /Users/jeremypeters/MEGA/development /learning/angular/material-learn/node_modules/@angular/cli/commands/generate.js:7:71 at new Promise () 在 GenerateCommand.getOptions (/Users/jeremypeters/MEGA/development/学习/角度/材料学习/node_modules/@angular/cli/models/schematic-command.js:193:41)在 GenerateCommand。(/Users/jeremypeters/MEGA/development/learning/angular/material-learn/node_modules/@angular/cli/commands/generate.js:38:53) 在 Generator.next () 在 /Users/jeremypeters/MEGA/development /learning/angular/material-learn/node_modules/@angular/cli/commands/generate.js:7:71 at new Promise () 41) 在生成命令处。(/Users/jeremypeters/MEGA/development/learning/angular/material-learn/node_modules/@angular/cli/commands/generate.js:38:53) 在 Generator.next () 在 /Users/jeremypeters/MEGA/development /learning/angular/material-learn/node_modules/@angular/cli/commands/generate.js:7:71 at new Promise () 41) 在生成命令处。(/Users/jeremypeters/MEGA/development/learning/angular/material-learn/node_modules/@angular/cli/commands/generate.js:38:53) 在 Generator.next () 在 /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