Electron failed to install correctly, please delete node_modules/electron and try installing again。
原因升级Electron到7.0.0,提示:Electron failed to install correctly, please delete node_modules/electron and try installing againat getElectronPath (xxxxx\node_modules\electron\index.js:14:11)打开index.js,发现问题是找
·
原因
升级Electron到7.0.0,提示:
Electron failed to install correctly, please delete node_modules/electron and try installing again
at getElectronPath (xxxxx\node_modules\electron\index.js:14:11)
打开index.js,发现问题是找不到 path.txt。
手动运行: node node_modules\electron\install.js 无法解决。
发现是downloadArtifact这个函数,下载得太慢了,只有十几KB每秒。
前往淘宝镜像:https://npm.taobao.org/mirrors/electron/7.0.0/
手动下载对应的包,我用windows,所以下载electron-v7.0.0-win32-x64.zip,然后在node_modules\electron\下创建dist文件夹。将下载的压缩包解压进刚刚创建的dist。
在node_modules\electron\中创建path.txt,内容为electron.exe(对应自己的平台,不同平台不一样)。
原文中,只证实了方案一。方案二待验证。
更多推荐


所有评论(0)