Jupyter lab build hangs and then fails at webpack --config webpack.prod.minimize.config.js

Thank you for the responses. As it is not feasible right now for me to move to a bigger server, I want to remove the extensions that started it all (and use the terminal for Git ). But when I try to uninstall the extension it finally re-builds and goes into the same loop erroring out .

[root@ip-10-0-0-86 /]# jupyter labextension uninstall --all
Uninstalling nbdime-jupyterlab from /root/anaconda3/share/jupyter/lab/extensions
Uninstalling @jupyterlab/git from /root/anaconda3/share/jupyter/lab/extensions
Building jupyterlab assets (build:prod:minimize)
An error occured.
RuntimeError: JupyterLab failed to build
See the log file for details:  /tmp/jupyterlab-debug-r_zld6j5.log

And the log shows the same error on 
$ ensure-max-old-space webpack --config webpack.prod.config.js
child_process.js:637
throw err;

For getting the git extension I installed npm, nodejs and the git extension.

Now how can I go remove the lab extension (and webpack) from the build. I want to go back to my working jupyterlab install (without extension) ? Do I have to re-install jupyterlab? If so can someone give the clean way to un-install /re-install.

Thanks
Thomas