错误中的错误:元数据版本不匹配

时间:2017-11-26 19:02:02

标签: angular primeng mismatch

我是棱角分明的新人(现在使用v.4),我正在为我的学习项目工作,这也是我第一次尝试Primeng模块。 我试图将“datagrid”集成到我的项目中,在我做了“ng serve”之后,我遇到了这个错误:

[在此处输入图像说明] [1]

错误中的错误:模块C的元数据版本不匹配:/Users/ASUS/Desktop/test1/node_modules/primeng/components/common/api.d.ts, 发现版本4,预期3,在C中解析符号AppModule:/Users/ASUS/Desktop/test1/src/app/app.module.ts,解析符号App C中的模块:/Users/ASUS/Desktop/test1/src/app/app.module.ts     在错误(本机)     at syntaxError(C:\ Users \ ASUS \ Desktop \ test1 \ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js:1729:34)     在simplifyInContext(C:\ Users \ ASUS \ Desktop \ test1 \ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js:24979:23)     在StaticReflector.simplify(C:\ Users \ ASUS \ Desktop \ test1 \ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js:24991:13)     在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)     在Function.NgTools_InternalApi_NG_2.listLazyRoutes(C:\ Users \ ASUS \ Desktop \ test1 \ node_modules \ @angular \ compiler-cli \ src \ ngtool) s_api.js:91:39)     在AotPlugin._getLazyRoutesFromNgtools(C:\ Users \ ASUS \ Desktop \ test1 \ node_modules \ @ngtools \ webpack \ src \ plugin.js:212:44)     在_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)

有人可以告诉我该怎么办?我检查了其他类似的问题,但我没有得到我应该做的解决这个问题:x

1 个答案:

答案 0 :(得分:1)

我也有同样的错误,错误是由于版本不匹配与依赖关系, i,所有依赖关系不在同一个版本,要解决此更新所有依赖项或将所有降级到通用版本,更新是更好的选项, 此链接有助于升级所有依赖项, https://angular-update-guide.firebaseapp.com/