I\'m learning Angular Material and I\'m getting this error when importing { MatButtonModule } from \"@angular/material/button\".
From what I read in other answers, it lo
First please check in module.ts
file that in @NgModule
all properties are only one time.
If any of are more than one time then also this error come.
Because I had also occur this error but in module.ts
file entryComponents
property were two time that's why I was getting this error.
I resolved this error by removing one time entryComponents
from @NgModule
.
So, I recommend that first you check it properly.
These issue arise generally due to mismatch between @ngx-translate/core version and Angular .Before installing check compatible version of corresponding ngx_trnalsate/Core, @ngx-translate/http-loader and Angular at https://www.npmjs.com/package/@ngx-translate/core
Eg: For Angular 6.X versions,
npm install @ngx-translate/core@10 @ngx-translate/http-loader@3 rxjs --save
Like as above, follow below command and rest of code part is common for all versions(Note: Version can obtain from( https://www.npmjs.com/package/@ngx-translate/core)
npm install @ngx-translate/core@version @ngx-translate/http-loader@version rxjs --save
Adding skipLibCheck: true
in compilerOptions
inside tsconfig.json
file fixed my issue.
"compilerOptions": {
"skipLibCheck": true,
},
I had this problem but didn't have a version conflict in my package.json.
My package-lock.json was somehow out of sync with package json though. Deleting and regenerating it worked for me.
I solved the same issue by following steps:
Check the angular version: Using command: ng version My angular version is: Angular CLI: 7.3.10
After that I have support version of ngx bootstrap from the link: https://www.npmjs.com/package/ngx-bootstrap
In package.json file update the version: "bootstrap": "^4.5.3", "@ng-bootstrap/ng-bootstrap": "^4.2.2",
Now after updating package.json, use the command npm update
After this use command ng serve and my error got resolved
Just update your package
command: npm i