当前位置:网站首页>Electron安装问题
Electron安装问题
2022-07-05 17:57:00 【寒墨茗殇】
项目输入: npm config edit
在registry 下面添加,并替换了 registry
registry=https://registry.npm.taobao.org/
disturl=https://npm.taobao.org/mirrors/node
electron_mirror=https://cdn.npm.taobao.org/dist/electron/
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/安装electron失败 postinstall: `node install.js`
npm config set electron_mirror "https://npm.taobao.org/mirrors/electron/"Electron预加载:
新建preload.js 在src下面
preload.js:
var electron_re=require('electron')
window.electron=electron_remain.js:
const {
BrowserWindow,
} = require('electron')
new BrowserWindow({
width: 1100,
height: 720,
minWidth: 1100,
minHeight: 720,
webPreferences: {
nodeIntegration: true,
preload: path.join(__dirname, '/preload.js'),
nativeWindowOpen: true,
contextIsolation: false,//需要false
webSecurity: false
},
icon: `${__static}/icon/favicon.ico`
})
win.loadURL('app://./index.html')vue.config.js:
module.exports = {
pluginOptions:{
electronBuilder:{
preload:'src/preload.js',
target: "electron-renderer"
}
}
}打包可能遇到的问题
* 1. 打包时下载electron-v.xxxx.zip文件失败
* 解决办法:直接在淘宝的文件库下载对应版本和打包平台的文件,下载完成后放在 C:\Users\Administrator\AppData\Local\electron\Cache这个目录下
* 2. 打包时下载winCodeSign-v.xxx.7z文件失败
* 下载地址:https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.5.0/winCodeSign-2.5.0.7z
* 下载完解压放到C:\Users\Administrator\AppData\Local\electron-builder\Cache\winCodeSign目录下
* 3. 打包时下载nsis-v.xxx.7z文件失败
* 下载地址:https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-3.0.3.2/nsis-3.0.3.2.7z
* 下载完解压放到C:\Users\Administrator\AppData\Local\electron-builder\Cache\nsis
* 4. 打包时下载nsis-resources-v.xxx.7z文件失败
* 下载地址:https://github.com/electron-userland/electron-builder-binaries/releases/download/nsis-resources-3.4.1/nsis-resources-3.4.1.7z
* 下载完解压放到C:\Users\Administrator\AppData\Local\electron-builder\Cache\nsis\nsis-resources-3.4.1
边栏推荐
- 图像分类,看我就够啦!
- [paddleclas] common commands
- Record a case of using WinDbg to analyze memory "leakage"
- ISPRS2022/云检测:Cloud detection with boundary nets基于边界网的云检测
- Mask wearing detection based on yolov3
- Daily exercise: a series of dates
- GFS分布式文件系统
- 使用QT遍历Json文档及搜索子对象
- 图片数据不够?我做了一个免费的图像增强软件
- Gimp 2.10 tutorial "suggestions collection"
猜你喜欢

「运维有小邓」用于云应用程序的单点登录解决方案

Le cours d'apprentissage de la machine 2022 de l'équipe Wunda arrive.

Image classification, just look at me!

How awesome is the architecture of "12306"?

U-Net: Convolutional Networks for Biomedical Images Segmentation

Ten capabilities that cyber threat analysts should have
![最大人工岛[如何让一个连通分量的所有节点都记录总节点数?+给连通分量编号]](/img/8b/a60fc36115580f018445e4c2a28a9d.png)
最大人工岛[如何让一个连通分量的所有节点都记录总节点数?+给连通分量编号]

Sophon CE社区版上线,免费Get轻量易用、高效智能的数据分析工具

About Estimation with Cross-Validation

EPM related
随机推荐
Check namespaces and classes
Cmake tutorial Step2 (add Library)
Simple query cost estimation
Sophon CE社区版上线,免费Get轻量易用、高效智能的数据分析工具
Sophon autocv: help AI industrial production and realize visual intelligent perception
Compared with the loss of Wenxin, the performance is improved a lot
吳恩達團隊2022機器學習課程,來啦
Teamcenter 消息注册前操作或后操作
ITK Example
“12306” 的架构到底有多牛逼?
Six bad safety habits in the development of enterprise digitalization, each of which is very dangerous!
Data access - entityframework integration
模拟百囚徒问题
【PaddleClas】常用命令
EPM related
Redis Foundation
删除数组中的某几个元素
Thesis reading_ Chinese NLP_ LTP
分享:中兴 远航 30 pro root 解锁BL magisk ZTE 7532N 8040N 9041N 刷机 刷面具原厂刷机包 root方法下载
ELK日志分析系统