Error during ionic resources

While generating platform resources I have the following error:
Error: socket hang up
Sometimes it happens at 39/48 complete, sometimes just at the start, sometimes at 44/48, pretty much randomly, how to deal with this?