ionic使用prod编译报错

2
266

使用ionic cordova run android没有报错,编译正常,但加上–prod编译发布版本报错,报错如下:

PS C:\Users\coloz\Desktop\iotapp> ionic cordova run android –prod
Running app-scripts build: –prod –platform android –target cordova
[13:02:15] build prod started …
[13:02:15] clean started …
[13:02:16] clean finished in 8 ms
[13:02:16] copy started …
[13:02:16] deeplinks started …
[13:02:16] deeplinks finished in 216 ms
[13:02:16] ngc started …
Error: Metadata version mismatch for module C:/Users/coloz/Desktop/iotapp/node_modules/@ionic/storage/dist/src/storage.d.ts, found version 4, expected 3
at StaticSymbolResolver.getModuleMetadata (C:\Users\coloz\Desktop\iotapp\node_modules\@angular\compiler\bundles\compiler.umd.js:25748:34)
at StaticSymbolResolver._createSymbolsOf (C:\Users\coloz\Desktop\iotapp\node_modules\@angular\compiler\bundles\compiler.umd.js:25536:46)
at StaticSymbolResolver.getSymbolsOf (C:\Users\coloz\Desktop\iotapp\node_modules\@angular\compiler\bundles\compiler.umd.js:25517:14)
at C:\Users\coloz\Desktop\iotapp\node_modules\@angular\compiler\bundles\compiler.umd.js:24376:30
at Array.forEach ()
at extractProgramSymbols (C:\Users\coloz\Desktop\iotapp\node_modules\@angular\compiler\bundles\compiler.umd.js:24375:79)
at AotCompiler.analyzeModulesAsync (C:\Users\coloz\Desktop\iotapp\node_modules\@angular\compiler\bundles\compiler.umd.js:23931:47)
at CodeGenerator.codegen (C:\Users\coloz\Desktop\iotapp\node_modules\@angular\compiler-cli\src\codegen.js:32:14)
at Function.NgTools_InternalApi_NG_2.codeGen (C:\Users\coloz\Desktop\iotapp\node_modules\@angular\compiler-cli\src\ngtools_api.js:73:30)
at Object.doCodegen (C:\Users\coloz\Desktop\iotapp\node_modules\@ionic\app-scripts\dist\aot\codegen.js:6:51)
[13:02:20] copy finished in 4.98 s

Error: Metadata version mismatch for module
模块版本不符,估计可能是我在另一台电脑时,更新了模块造成的
ionic官方github上解决方法:删除项目下的node_modules,并重新安装所有模块。
实际测试,还是没有解决问题。

2 意见

留下一个答复

Please enter your comment!
Please enter your name here