npm使用国内镜像安装Electron

shell:

ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ npm install --registry=https://registry.npmmirror.com -g electron

如仍然无法运行,cdnode_modules/electron/,执行

ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ node install.js

Windows cmd:

set ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
npm install --registry=https://registry.npmmirror.com -g electron

如仍然无法运行,cdnode_modules/electron/,执行

set ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
node install.js