Search code examples
angularprimengmismatch

ERROR in Error: Metadata version mismatch


i'm new to angular ( using v.4 for now) and i'm working on a project for my studies and it's also my first time trying Primeng modules. I tried to integrate the "datagrid" to my project and after i did "ng serve", i've got this error :

[enter image description here][1]

ERROR in Error: Metadata version mismatch for module C:/Users/ASUS/Desktop/test1/node_modules/primeng/components/common/api.d.ts, found version 4, expected 3, resolving symbol AppModule in C:/Users/ASUS/Desktop/test1/src/app/app.module.ts, resolving symbol App Module in C:/Users/ASUS/Desktop/test1/src/app/app.module.ts at Error (native) at syntaxError (C:\Users\ASUS\Desktop\test1\node_modules\@angular\compiler\bundles\compiler.umd.js:1729:34) at simplifyInContext (C:\Users\ASUS\Desktop\test1\node_modules\@angular\compiler\bundles\compiler.umd.js:24979:23) at StaticReflector.simplify (C:\Users\ASUS\Desktop\test1\node_modules\@angular\compiler\bundles\compiler.umd.js:24991:13) at StaticReflector.annotations (C:\Users\ASUS\Desktop\test1\node_modules\@angular\compiler\bundles\compiler.umd.js:24418:41) at _getNgModuleMetadata (C:\Users\ASUS\Desktop\test1\node_modules\@angular\compiler-cli\src\ngtools_impl.js:138:31) at _extractLazyRoutesFromStaticModule (C:\Users\ASUS\Desktop\test1\node_modules\@angular\compiler-cli\src\ngtools_impl.js:109: 26) at Object.listLazyRoutesOfModule (C:\Users\ASUS\Desktop\test1\node_modules\@angular\compiler-cli\src\ngtools_impl.js:53:22) at Function.NgTools_InternalApi_NG_2.listLazyRoutes (C:\Users\ASUS\Desktop\test1\node_modules\@angular\compiler-cli\src\ngtool s_api.js:91:39) at AotPlugin._getLazyRoutesFromNgtools (C:\Users\ASUS\Desktop\test1\node_modules\@ngtools\webpack\src\plugin.js:212:44) at _donePromise.Promise.resolve.then.then.then.then.then (C:\Users\ASUS\Desktop\test1\node_modules\@ngtools\webpack\src\plugin .js:448:24) at process._tickCallback (internal/process/next_tick.js:109:7)

Please can someone tell me what should i do ? i checked other similar questions but i didn't get what i'm supposed to do to solve this problem :x


Solution

  • I also had the same error, the error is because of version mismatch with the dependencies, i,e all the dependencies are not in the same version, to solve this update all the dependencies or downgrade all to the common version, update is the better options, this link helps to upgrade all the dependencies, https://angular-update-guide.firebaseapp.com/