Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.5k views
in Technique[技术] by (71.8m points)

angular - Call retries were exceeded exception while ng build

I am facing an exception while ng build (generating ES5 bundles for differential loading...)

An unhandled exception occured: Call retires were exceeded

Used versions:

  • Angular-CLI: 8.3.20
  • Angular: 8.2.7
  • Node: 12.12.1

Also in logs, it is mentioned

[error] Error: Call retries were exceeded at ChildProcessWorker.initialize
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

ORIGINAL

Basically the build process is running out of memory: see related angular-cli issues #15493, #16515

The recommended remedy is to:

  • 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

As a quick workaround it could also work to use older versions of angular/cli and build-angular:

"devDependencies": {
    "@angular-devkit/build-angular": "0.803.20",
    "@angular/cli": "8.3.20",

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...