The similar message will look like this: Installation failed, reverting /composer.json to its original content
The following exception is caused by a lack of memory and not having swap configure
We have to say this absolutely from your server. You should contact your developer (or the one who help you setup your store), or you can contact your host provider, ask them about this issue, they will help you out.
A workaround solution for this is to add this line to bin/magento file: ini_set( memoy_limit', '2048M'). The result will look like the attachment (view online https://prnt.sc/hsplju)