今日もシュクシュクと!

ソフトウェア・エンジニアを目指して修行中の日々。学習もコツコツと。そして粛々と。

error TS2315: Type 'ElementRef' is not generic.

angular materialを使用しようとしたら「error TS2315: Type 'ElementRef' is not generic.」というエラーが発生

ERROR in ../../node_modules/@angular/material/autocomplete/typings/autocomplete-origin.d.ts(15,17): error TS2315: Type 'ElementRef' is not generic.
../../node_modules/@angular/material/autocomplete/typings/autocomplete-origin.d.ts(18,21): error TS2315: Type 'ElementRef' is not generic.
../../node_modules/@angular/material/button-toggle/typings/button-toggle.d.ts(136,21): error TS2315: Type 'ElementRef' is not generic.
../../node_modules/@angular/material/button-toggle/typings/button-toggle.d.ts(156,104): error TS2315: Type 'ElementRef' is not generic.
../../node_modules/@angular/material/form-field/typings/form-field.d.ts(91,30): error TS2315: Type 'ElementRef' is not generic.
../../node_modules/@angular/material/slide-toggle/typings/slide-toggle.d.ts(58,15): error TS2315: Type 'ElementRef' is not generic.
../../node_modules/@angular/material/slide-toggle/typings/slide-toggle.d.ts(60,18): error TS2315: Type 'ElementRef' is not generic.

原因と対応: MaterialとCoreの依存関係が正しく無い為、Material側のバージョンをCoreに合わせるようにpackage.jsonを書き換えて、npm install を再実行する

  "dependencies": {
    "@angular/animations": "^5.2.0",
    "@angular/cdk": "^5.2.0",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",