ng生成时超出了呼叫重试异常 [英] Call retries were exceeded exception while ng build
问题描述
ng build
时我遇到异常(正在生成ES5捆绑包以进行差异加载...)
I am facing an exception while ng build
(generating ES5 bundles for differential loading...)
An unhandled exception occured: Call retires were exceeded
使用的版本:
- Angular-CLI:
8.3.20
- 角度:
8.2.7
- 节点:
12.12.1
- Angular-CLI:
8.3.20
- Angular:
8.2.7
- Node:
12.12.1
也在日志中被提及
[error] Error: Call retries were exceeded at ChildProcessWorker.initialize
推荐答案
更新10.02.2019
这是@angular/cli
的问题.将版本更新为>= 8.3.22
应该可以解决此问题:请参阅#中的此注释16515
Update 10.02.2019
This was a problem of the @angular/cli
. Updating the version to >= 8.3.22
should fix the issue: see this comment in #16515
基本上,构建过程的内存不足:请参阅相关的angular-cli问题#15493 ,#16515
Basically the build process is running out of memory: see related angular-cli issues #15493, #16515
建议的补救措施是:
- 将节点更新为最新版本,例如
12.14.0
- 增加构建过程的内存:
- 在您的
package.json
中,将"build"
脚本更改为:node --max_old_space_size=4096 node_modules/@angular/cli/bin/ng build
- 在这种情况下,内存增加到
4GB
根据您的项目规模,您可能需要更多
- update node to the latest version e.g.
12.14.0
- increase the memory for the build process:
- in your
package.json
change the"build"
script to:node --max_old_space_size=4096 node_modules/@angular/cli/bin/ng build
- in this case the memory is increased to
4GB
depending on the size of your project you may need more
作为快速的解决方法,使用
angular/cli
和build-angular
的旧版本也可以:As a quick workaround it could also work to use older versions of
angular/cli
andbuild-angular
:"devDependencies": { "@angular-devkit/build-angular": "0.803.20", "@angular/cli": "8.3.20",
另一种解决方法是禁用差异加载(即跳过ES5捆绑包的生成) ,如果您想要这个.然后,构建过程将需要较少的内存并且可以工作.
Another workaround is to disable differential-loading (i.e. skip generation of ES5 bundles), if you want this. Then the build-process will need less memory and may work.
这篇关于ng生成时超出了呼叫重试异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- in your
- 在您的