electron install 失败问题


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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM