ERROR in node_modules/@angular/material/button-toggle/typings/button-toggle.d.ts(136,20):
error TS2315: Type 'ElementRef' is not generic.
node_modules/@angular/material/button-toggle/typings/button-toggle.d.ts(154,104):
error TS2315: Type 'ElementRef' is not generic
I'm trying to install material but it looks like that's the mistake.
DATA:
Angular CLI: 1.7.4
Node: 9.11.1
OK, here is how I fixed it: Step one:
npm update -D
andnpm update -S
But I don't think this was necessary, because the problem was stil there.Step tow:
The Command complainded that I needed to run (so I did):
After trying:
ng serve
I got an error since 'hammerjs' was not installed, so I run (but this might not be your case):and
npm install @types/hammerjs --save-dev
I don't understand the point of --save-dev, but I did it this way. Its compiling now.
This last hammerjs thing has been found here: Module not found: Error: Can't resolve 'hammerjs'
Hope this help.
Maybe its related to angular 1.6 that just came out ?
I have the same problem, but just can't figure out how to update the reste of it (instead of downgrade one thing, upgrade everything else thing), but I can't figure it out.
Tried
npm update -D
and thannpm update -S
But it did not help.That idea came from: I am new to angular. I just installed angular material and angular animations in my small project and got some of the errors
I had the same issues but downgrading my @angular/material to version 5.0 worked. You can try that out.
This error occurs when there is a mismatch in your angular version and material version. To see the error go to package.json file where you can find the angular version and the material version.
},
As you can see in the above package.json file there is mismatch of the version. There are two ways to solve this error:
This occurs when all of your angular packagage in one version and material package in another version.
I faced this when my angular package version was 5.2 and material version was 6.0 so i changed the material version back to 5.1 and the issue is fixed.
The best way here is to change all your material dependencies to match that of angular for those of you who have angular 5.2.0 follow this
INITIAL
just change these to whatever the current version of the other angular components are.
FINAL
THEN do
npm install