This article tries to resolve an uncommon issue when you encounter the following error and it cannot be resolved automatically, e.g. behind proxy, etc.:
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
Download the right version (with consideration of
package.json) of Electron from https://github.com/electron/electron/releases
Unpack the downloaded Electron and put all files under
path.txt file under
node_modules/electron with the following content:
Note: Make sure there is no whitespace characters (including a newline character) after the filename. This is a problem that I struggled for minutes and hours.