Electron安装时提示 Generated checksum for “electron-xxx.zip” did not match expected checksum 解决方法

Generated checksum for “electron-xxx.zip” did not match expected checksum 

解决方法:  

通过在执行npm时增加环境配置 ELECTRON_SKIP_BINARY_DOWNLOAD=1 来跳过二进制文件下载

# 调试模式安装electron 
npm install --save-dev --verbose electron 

# npm
ELECTRON_SKIP_BINARY_DOWNLOAD=1 npm install
# yarn
#ELECTRON_SKIP_BINARY_DOWNLOAD=1 yarn install

使用 --verbose 标志来显示下载进度:
npm install --verbose electron

其他方式:

删除相关的缓存文件后重新安装

macOS: 
~/Library/Caches/electron/ 删除相关的缓存文件


操作系统-Windows 10
$LOCALAPPDATA/electron/Cache or ~/AppData/Local/electron/Cache/

你可能感兴趣的:(Electron,electron,javascript,前端,npm)