1.node install.js的时候ctrl+c取消,y确定
2.cd ./node_modules/electron
3.下载https://cdn.npm.taobao.org/dist/electron/7.0.0/electron-v7.0.0-win32-x64.zip并复制到上面的文件夹,重命名为electron.zip
4.修改 ./node_modules/electron/install.js,如下:
#!/usr/bin/env node const version = require('./package').version const fs = require('fs') const os = require('os') const path = require('path') const extract = require('extract-zip') const platformPath = 'electron.exe' const zipPath = "./electron.zip" extractFile (zipPath) // unzips and makes path.txt point at the correct executable function extractFile (zipPath) { extract(zipPath, { dir: path.join(__dirname, 'dist') }, function (err) { if (err) return onerror(err) fs.writeFile(path.join(__dirname, 'path.txt'), platformPath, function (err) { if (err) return onerror(err) }) }) }
5../node_modules/electron目录下运行,node install.js
————————————————
版权声明:本文为CSDN博主「MiuAnan」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_27005821/java/article/details/102748201