Not sure if it is relevant, for my case, I encounter an error 137 only on the Jenkins instance even if 2gb of memory is assigned to it.
It was working fine for me if I build it on my own machine.
The fix was to turn off 'aot' and 'buildOptimizer' in angular.json configuration for the profile that you use. Works like a charm.