Angular 5 - 模块错误元数据版本不匹配

尝试构建我的angular 5项目时发生以下错误。我的版本是5.6.0,@ angular/material @ 5.0.1。Angular 5 - 模块错误元数据版本不匹配

C:\Users\Owner\ng7>ng build --prod Date: 2017-12-18T02:42:21.623Z Hash: 2c0633800516bc024772 Time: 16640ms chunk {0} styles.f7ba5027ddae0481d607.bundle.css (styles) 290 bytes {3} [initial] [rendered] chunk {1} polyfills.3bc34265385d52184eab.bundle.js (polyfills) 86 bytes {3} [initial] [rendered] chunk {2} main.e402deade8b026b7d50e.bundle.js (main) 84 bytes [initial] [rendered] chunk {3} inline.9d07561b59257af76b95.bundle.js (inline) 1.45 kB [entry] [rendered]

ERROR in Error: Metadata version mismatch for module C:/Users/Owner/ng7/node_modules/@angular/animations/animations.d.ts, found version 4, expected 3 at StaticSymbolResolver.getModuleMetadata (C:\Users\Owner\ng7\node_modules\@angular\compiler\bundles\compiler.umd.js:25616:34) at StaticSymbolResolver._createSymbolsOf (C:\Users\Owner\ng7\node_modules\@angular\compiler\bundles\compiler.umd.js:25404:46) at StaticSymbolResolver.getSymbolsOf (C:\Users\Owner\ng7\node_modules\@angular\compiler\bundles\compiler.umd.js:25385:14) at C:\Users\Owner\ng7\node_modules\@angular\compiler\bundles\compiler.umd.js:24241:30 at Array.forEach() at extractProgramSymbols (C:\Users\Owner\ng7\node_modules\@angular\compiler\bundles\compiler.umd.js:24240:79) at AotCompiler.analyzeModulesAsync (C:\Users\Owner\ng7\node_modules\@angular\compiler\bundles\compiler.umd.js:23796:47) at CodeGenerator.codegen (C:\Users\Owner\ng7\node_modules\@angular\compiler-cli\src\codegen.js:32:14) at Function.NgTools_InternalApi_NG_2.codeGen (C:\Users\Owner\ng7\node_modules\@angular\compiler-cli\src\ngtools_api.js:73:30) at _donePromise.Promise.resolve.then (C:\Users\Owner\ng7\node_modules\@ngtools\webpack\src\plugin.js:386:44) at

回答:

在你的角度项目的package.json文件

看看在@角/动画模块,并确保您使用的是@角/动画版本,这是角5标准。

从已共享

错误日志

ERROR in Error: Metadata version mismatch for module C:/Users/Owner/ng7/node_modules/@angular/animations/animations.d.ts, found version 4, expected 3 at StaticSymbolResolver.getModuleMetadata 

我可以断定,你仍然对角4和没有棱角5.你的要求更新所有依赖我的package.json到角5,你的情况特别是角度动画模块。

以上是 Angular 5 - 模块错误元数据版本不匹配 的全部内容, 来源链接: utcz.com/qa/260653.html

回到顶部