I had to tell Electron that it should use the proxy for get's:
set ELECTRON_GET_USE_PROXY=http://localhost:8888
then
npm i
See: https://www.electronjs.org/docs/latest/tutorial/installation#proxies