gpt4 book ai didi

angular-cli - 角度 5 到 7 更新后无法构建产品,更简洁错误

转载 作者:行者123 更新时间:2023-12-04 18:19:06 24 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





Error In Runtime From Terser During Build --prod

(10 个回答)


2年前关闭。




我有一个带有 Angular 5.2 的 Angular-cli 项目。我更新到 Angular 7.2.3。一切正常,ng serve , ng test ,但是当我想ng build --prod我收到错误

我一步一步跟着指南(https://update.angular.io/)

以下是错误:

ERROR in runtime.82c6613acef8f7246fe8.js from Terser
TypeError: Cannot read property 'minify' of undefined
at minify (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
at module.exports (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
at handle (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/worker-farm/lib/child/index.js:44:8)
at process.<anonymous> (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/worker-farm/lib/child/index.js:51:3)
at process.emit (events.js:180:13)
at emit (internal/child_process.js:783:12)
at process._tickCallback (internal/process/next_tick.js:178:19)
ERROR in main.ae88265d57a522e8fef6.js from Terser
TypeError: Cannot read property 'minify' of undefined
at minify (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
at module.exports (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
at handle (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/worker-farm/lib/child/index.js:44:8)
at process.<anonymous> (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/worker-farm/lib/child/index.js:51:3)
at process.emit (events.js:180:13)
at emit (internal/child_process.js:783:12)
at process._tickCallback (internal/process/next_tick.js:178:19)
ERROR in polyfills.93cd0d5603ed4cb47cce.js from Terser
TypeError: Cannot read property 'minify' of undefined
at minify (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
at module.exports (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
at handle (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/worker-farm/lib/child/index.js:44:8)
at process.<anonymous> (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/worker-farm/lib/child/index.js:51:3)
at process.emit (events.js:180:13)
at emit (internal/child_process.js:783:12)
at process._tickCallback (internal/process/next_tick.js:178:19)
ERROR in styles.dcc46c6ff0d6be4a76ad.js from Terser
TypeError: Cannot read property 'minify' of undefined
at minify (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
at module.exports (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
at handle (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/worker-farm/lib/child/index.js:44:8)
at process.<anonymous> (/Users/nicolasgarin/Desktop/afreecom/front/node_modules/worker-farm/lib/child/index.js:51:3)
at process.emit (events.js:180:13)
at emit (internal/child_process.js:783:12)
at process._tickCallback (internal/process/next_tick.js:178:19)

我不知道出了什么问题,谷歌也没有帮助我

最佳答案

这是当前版本的 terser 有问题,现在,您应该在 package.json 中将版本设置为 3.14.1,如下所示:"terser": "3.14.1",
如果您有 "terser": "^3.14.1",一定要删除 ^ .

关于angular-cli - 角度 5 到 7 更新后无法构建产品,更简洁错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54497980/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com