Angular material : Navigation schematics doesn't work

249 Views Asked by At

I want to create angular material navigation schematics. when i run ng generate @angular/material:navigation command it gives error.

The 'path' option in 'C:\Users\Pradeepa saravanan\Documents\TS\HotelInventoryApp\node_modules@angular\material\schematics\ng-generate\navigation\schema.json' is using deprecated behaviour. 'workingDirectory' smart default provider should be used instead. (0 , validation_1.validateName) is not a function

After that i update angular material using ng update @angular/material command. Again i got some error.

The installed Angular CLI version is outdated. Installing a temporary Angular CLI versioned 15.0.4 to perform the update. ✔ Packages successfully installed. Using package manager: npm Collecting installed dependencies... Found 30 dependencies. Fetching dependency metadata from registry... Updating multiple major versions of '@angular/material' at once is not supported. Please migrate each major version individually. Run 'ng update @angular/material@14' in your workspace directory to update to latest '14.x' version of '@angular/material'.

After I run 'ng update @angular/material@14' command, again getting error

Packages successfully installed.
Using package manager: npm
Collecting installed dependencies...
Found 30 dependencies.
Fetching dependency metadata from registry...
× Migration failed: 404 Not Found - GET https://registry.npmjs.org/@angular%2fCLI - Not found
  See "C:\Users\PRADEE~1\AppData\Local\Temp\ng-aPCtDl\angular-errors.log" for further details.

Help me to solve the issue

I tried to add angular material navigation schematics. continuously i got error and not able to solve myself.

1

There are 1 best solutions below

0
On

I had the same problem when working on an Angular project that used version 14, and the cli installed uses a later version temporarily to execute the command, luckily, I had the option to upgrade my application using the guide provided here.

When the CLI version was 16, and the project (package.json) reflect version 16 I could use the command without any issues.