2017-12-18 105 views
-1

嘗試構建我的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

回答

0
在你的角度項目的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,你的情況特別是角度動畫模塊。

相關問題