Ошибка при установке материала angular с использованием среды CLI - PullRequest
0 голосов
/ 09 апреля 2020

Я работаю с angular8 и хочу установить angular материал. Сначала я ввел следующую команду в среде CLI.

PS F:\Learn\PersonalWebSite\PersonalWebSite> ng add @angular/material
Installing packages for tooling via npm.
? Choose a prebuilt theme name, or "custom" for a custom theme: Indigo/Pink        [ Preview: https://material.angular.io?theme=indigo-pink ]
? Set up global Angular Material typography styles? Yes
? Set up browser animations for Angular Material? Yes
UPDATE package.json (1385 bytes)
√ Packages installed successfully.
UPDATE src/app/app.module.ts (950 bytes)
UPDATE angular.json (3943 bytes)
UPDATE src/index.html (540 bytes)

2: импорт в app.module.ts:

import { MatSliderModule } from '@angular/material/slider';
imports: [
    MatSliderModule
  ]

Ошибка в TERMINAL:

 ERROR in node_modules/@angular/platform-browser/animations/animations.d.ts:37:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

    This likely means that the library (@angular/platform-browser/animations) which declares BrowserAnimationsModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

    37 export declare class BrowserAnimationsModule {
                            ~~~~~~~~~~~~~~~~~~~~~~~
    node_modules/@angular/material/slider/slider-module.d.ts:8:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

    This likely means that the library (@angular/material/slider) which declares MatSliderModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

    8 export declare class MatSliderModule {

Консоль:

[WDS] Live Reloading enabled. client:52
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://localhost:44302/SubMenuSpecialities. (Reason: CORS request did not succeed).

ERROR 
Object { headers: {…}, status: 0, statusText: "Unknown Error", url: "https://localhost:44302/SubMenuSpecialities", ok: false, name: "HttpErrorResponse", message: "Http failure response for https://localhost:44302/SubMenuSpecialities: 0 Unknown Error", error: error }
core.js:6185:19
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://localhost:44302/SubMenuDossiers. (Reason: CORS request did not succeed).

ERROR 
Object { headers: {…}, status: 0, statusText: "Unknown Error", url: "https://localhost:44302/SubMenuDossiers", ok: false, name: "HttpErrorResponse", message: "Http failure response for https://localhost:44302/SubMenuDossiers: 0 Unknown Error", error: error }
core.js:6185:19
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://localhost:44302/Menus. (Reason: CORS request did not succeed).

ERROR 
Object { headers: {…}, status: 0, statusText: "Unknown Error", url: "https://localhost:44302/Menus", ok: false, name: "HttpErrorResponse", message: "Http failure response for https://localhost:44302/Menus: 0 Unknown Error", error: error }
core.js:6185:19
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://localhost:44302/SubMenuDocs. (Reason: CORS request did not succeed).

ERROR 
Object { headers: {…}, status: 0, statusText: "Unknown Error", url: "https://localhost:44302/SubMenuDocs", ok: false, name: "HttpErrorResponse", message: "Http failure response for https://localhost:44302/SubMenuDocs: 0 Unknown Error", error: error }

Как мне решить мою проблему и использовать angular материал?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...