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\node_modules\@angular-devkit\build-angular\src\angular-cli-files\plugins\index-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%\web\apps\fi\gl\web\ /Y /D /R /K /F /S && xcopy .\dist\* E:\projects\fi\gl\AccountBalance\balanceinit\web\apps\fi\gl\web\ /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:\Users\wangbo03\AppData\Roaming\npm-cache\_logs\2020-01-07T07_22_03_706Z-debug.log

原因是node_modules 包损坏或不完整

重新安装node_modules问题解决

参考:

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