当前位置:网站首页>1.Electron开发环境搭建
1.Electron开发环境搭建
2022-04-23 11:36:00 【好奇的菜鸟】
前置条件:电脑上的node.js环境正常;
#查看node版本
node -v
#查看node包管理工具版本
npm -v
#查看默认仓库
npm config ls
查看npm仓库,建议使用国内镜像;
npm config set registry https://registry.npm.taobao.org
一、新建开发目录初始化项目(全局安装忽略这一步)
npm init --yes
会生成一个package.json文件
二、安装electron依赖
npm install electron --save-dev
#全局安装
npm install -g electron
命令说明:
npm install xxx :安装某个module到本地项目的node_modules,但不会把安装包的信息添加到package.json文件
npm install xxx --save:安装某个module到本地项目的node_modules文件夹,同时把相关模块依赖添加到package.json文件的dependencies中
npm install xxx --save-dev:安装某个module到本地项目的node_modules文件夹,同时把相关模块依赖添加到package.json文件的devDependencies
npm install xxx -g:与npm install module一样,只是module的安装是全局的
npm install xxx --save -g :与npm install module --save一样,只是module的安装是全局的
npm install xxx --save-dev -g:与npm install module --save-dev一样,只是module的安装是
三、检查安装结果
#二选一即可,全局安装使用第一个命令
npx electron -v
./node_modules/.bin/electron -v
如果没有看到版本号,重新安装即可
四、查看electron界面
#全局安装使用
npx electron
./node_modules/.bin/electron
默认界面
版权声明
本文为[好奇的菜鸟]所创,转载请带上原文链接,感谢
https://yjtzfywh.blog.csdn.net/article/details/124360630
边栏推荐
- MIT: label every pixel in the world with unsupervised! Humans: no more 800 hours for an hour of video
- Interpreting the art created by robots
- Detailed explanation of how to smoothly go online after MySQL table splitting
- MySQL interview questions explain how to set hash index
- SOFA Weekly | 年度优秀 Committer 、本周 Contributor、本周 QA
- Canvas详解
- PyTorch 神经网络训练器
- 简易投票系统数据库设计
- R-drop: a more powerful dropout regularization method
- Advanced file IO of system programming (13) -- IO multiplexing - Select
猜你喜欢
讯飞2021年营收183亿:同比增41% 净利为15.56亿
Resolution due to AMD not found_ ags_ x64. DLL, unable to continue code execution. Reinstallation of the program may solve this problem, Forza horizon 5
解读2022机器人教育产业分析报告
探究机器人教育的器材与教学
Redis学习之五---高并发分布式锁实战
论坛系统数据库设计
Redis optimization series (II) redis master-slave principle and master-slave common configuration
解读机器人创造出来的艺术
Canvas详解
5个免费音频素材网站,建议收藏
随机推荐
QT信号量 无法解析的错误的总结
Practical data Lake iceberg lesson 30 MySQL - > iceberg, time zone problems of different clients
Docker MySQL master-slave backup
赛微微电科创板上市破发:跌幅达26% 公司市值44亿
Compress the curl library into a sending string of utf8 and send it with curl library
Simple construction of rebbitmq
MySQL interview questions explain how to set hash index
Significance of actively participating in middle school robot competition
Solve the problem of "suncertpathbuilderexception: unable to find valid certification path to requested target"
Applet payment
全网最细的短网址系统设计与实战
MySQL Router重装后重新连接集群进行引导出现的——此主机中之前已配置过的问题
laravel-admin表单验证
On the integration of steam education in early childhood education
qt5.8 64 位静态库中想使用sqlite但静态库没有编译支持库的方法
Pytorch neural network trainer
Design and practice of the smallest short website system in the whole network
Tclerror: no display name and no $display environment variable
Learning go language 0x02: understanding slice
Redis learning 5 - high concurrency distributed lock practice