1

Below error is thrown while trying to run ng generate @angular/material-nav --name=main-nav command in angular 6. Can anyone please help me to sort out this>

Error: Schematic "@angular/material-nav" not found in collection "@schematics/angular".

Dependencies:
"dependencies": {
    "@angular/animations": "^6.0.6",
    "@angular/cdk": "^6.3.0",
    "@angular/common": "^6.0.3",
    "@angular/compiler": "^6.0.3",
    "@angular/core": "^6.0.3",
    "@angular/forms": "^6.0.3",
    "@angular/http": "^6.0.3",
    "@angular/material": "^6.3.0",
    "@angular/platform-browser": "^6.0.3",
    "@angular/platform-browser-dynamic": "^6.0.3",
    "@angular/router": "^6.0.3",
    "core-js": "^2.5.4",
    "rxjs": "^6.0.0",
    "zone.js": "^0.8.26"
  },
לבני מלכה
  • 15,925
  • 2
  • 23
  • 47
  • see here:https://stackoverflow.com/questions/51003953/angularcli-and-angular-material-schematics-error-collection-angular-materia – לבני מלכה Jun 24 '18 at 12:12
  • Tried the solution provided in here [https://stackoverflow.com/questions/51003953/angularcli-and-angular-material-schematics-error-collection-angular-materia] , I'm able to add button component but unable to run 'ng generate @angular/material-nav --name=main-nav' – Raji Muthukumar Jun 24 '18 at 12:16

1 Answers1

0

I could not find any open issue on GitHub for the time being downgrade your @angular/cdk:"6.0.0" and "@angular/material": "6.0.0"

Modify your package.json

"dependencies": {
        "@angular/animations": "^6.0.6",
        "@angular/cdk": "6.0.0",
        "@angular/common": "^6.0.3",
        "@angular/compiler": "^6.0.3",
        "@angular/core": "^6.0.3",
        "@angular/forms": "^6.0.3",
        "@angular/http": "^6.0.3",
        "@angular/material": "6.0.0",
        "@angular/platform-browser": "^6.0.3",
        "@angular/platform-browser-dynamic": "^6.0.3",
        "@angular/router": "^6.0.3",
        "core-js": "^2.5.4",
        "rxjs": "^6.0.0",
        "zone.js": "^0.8.26"
      },

Execute npm i

Vikas
  • 11,859
  • 7
  • 45
  • 69