This worked for me to install electron. However I got a 404 on xtract-zip:
npm ERR! 404 'xtract-zip' is not in the npm registry.
I instead did:
npm install email@example.com
Also, I noticed I was getting errors for writing to the node_modules directories, so I used chown on them:
sudo chown -R $(whoami) ~/.npm sudo chown -R $USER /usr/lib/node_modules
Not sure if they all were needed, but I wanted to document all of my steps to hopefully help.