'mat-tree' is not a known element:
08:29 08 Jun 2020

I get and error when I try to add the expmle tree of material.angular

ERROR in src/app/features/itemmonitor/data-options-tree/data-options-tree.component.html:1:1 - error NG8001: 'mat-tree' is not a known element: 1. If 'mat-tree' is an Angular component, then verify that it is part of this module. 2. If 'mat-tree' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

data-options-tree.component.spec.ts


   parent node 
   -- child node1 
   -- child node2 

item-monitor.module.ts

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DataOptionsTreeComponent } from './data-options-tree/data-options-tree.component';
import { MatTreeModule } from '@angular/material/tree';

@NgModule({
  declarations: [DataOptionsTreeComponent],
  imports: [
    CommonModule,
    MatTreeModule,
  ],
})
export class ItemMonitorModule { }

My package.json dependencies

 "dependencies": {
    "@angular/animations": "~9.1.9",
    "@angular/cdk": "~9.2.4",
    "@angular/common": "~9.1.9",
    "@angular/compiler": "~9.1.9",
    "@angular/core": "~9.1.9",
    "@angular/forms": "~9.1.9",
    "@angular/material": "~9.2.4",
    "@angular/platform-browser": "~9.1.9",
    "@angular/platform-browser-dynamic": "~9.1.9",
    "@angular/router": "~9.1.9",
    "rxjs": "~6.5.5",
    "thrift": "git+https://github.com/apache/thrift.git",
    "tslib": "^2.0.0",
    "zone.js": "~0.10.3"
  },
javascript angular angular-material