angular ng build 报错 Cannot read property 'default' of undefined

95% emitting index-html-webpack-plugin Cannot read property 'default' of undefined
TypeError: Cannot read property 'default' of undefined
at compiler.hooks.emit.tapPromise (E:projects ode_modules@angular-devkituild-angularsrcangular-cli-filespluginsindex-html-webpack-plugin.js:82:53)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! farris-scaffold@0.0.0 pack: `ng build --base-href=/apps/fi/gl/web/balanceinit/ --aot && xcopy .dist* %EnvPath%webappsfiglweb /Y /D /R /K /F /S && xcopy .dist* E:projectsfiglAccountBalancealanceinitwebappsfiglweb /Y /D /R /K /F /S`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the farris-scaffold@0.0.0 pack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:Userswangbo03AppDataRoaming pm-cache\_logs2020-01-07T07_22_03_706Z-debug.log

原因是node_modules 包损坏或不完整

重新安装node_modules问题解决

参考:

https://forum.radzen.com/t/typeerror-cannot-read-property-default-of-undefined/1282

原文地址:https://www.cnblogs.com/wolbo/p/12161941.html