Call retries were exceeded exception while ng build

走远了吗. 提交于 2020-08-21 05:49:42

问题


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

回答1:


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.




回答2:


For me editing tsconfig.json resolved my problem.

There was a change in @angular-devkit/build-angular which updated the differential loading. To fix this in your Ionic project, change the target value from “es2015” to “es5” in your tsconfig.json

For more details :- https://forum.ionicframework.com/t/ionic-cordova-build-get-stuck-at-generating-es5-bundles-for-differential-loading/180202/4




回答3:


I have also met the same issue, by changing the angular/cli version to 8.3.19, the issue has been resolved.




回答4:


I am using Angular 10.05 and I had the same issue

You can run npm run build instead of ng build

It worked for me without any changes like updating of Angular/CLI etc.




回答5:


Might not be an appropriate answer(can't comment), but it worked for me. I just deleted node_modules/ and reinstalled.




回答6:


its really work just remove node_modules and install again, its working fine



来源:https://stackoverflow.com/questions/59531305/call-retries-were-exceeded-exception-while-ng-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!