当前位置:网站首页>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
边栏推荐
- 解读2022机器人教育产业分析报告
- Study notes of C [8] SQL [1]
- QT信号量 无法解析的错误的总结
- Redis学习之五---高并发分布式锁实战
- MySQL Router重装后重新连接集群进行引导出现的——此主机中之前已配置过的问题
- Link sorting of tutorials such as assembly language running environment setting
- 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
- Cognition and R & D technology of micro robot
- 讯飞2021年营收183亿:同比增41% 净利为15.56亿
- Significance of actively participating in middle school robot competition
猜你喜欢

让中小学生在快乐中学习的创客教育

R-drop: a more powerful dropout regularization method

解读2022机器人教育产业分析报告

Nacos Foundation (7): Configuration Management

Get things technology network optimization - CDN resource request Optimization Practice

零钱兑换II——【LeetCode】

IFLYTEK's revenue in 2021 was 18.3 billion yuan: a year-on-year increase of 41% and a net profit of 1.556 billion yuan

qt5. 8. You want to use SQLite in the 64 bit static library, but the static library has no method to compile the supporting library

系统编程之高级文件IO(十三)——IO多路复用-select

Write console script by laravel
随机推荐
5个免费音频素材网站,建议收藏
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
Change exchange II - [leetcode]
Laravel adds custom helper functions
卷积层和池化层总结
Analyzing the role of social robots in basic science
Learn go language 0x07: stringer exercise code in go language journey
Summary of convolution layer and pooling layer
项目实训-火爆辣椒
GPU, CUDA,cuDNN三者的关系总结
QT信号量 无法解析的错误的总结
Design and practice of the smallest short website system in the whole network
laravel 永远返回 JSON 响应
Understanding of fileprovider path configuration strategy
ES6 learning notes II
Nacos Foundation (9): Nacos configuration management from single architecture to microservices
Docker MySQL master-slave backup
Database design of forum system
Database design of simple voting system
云呐|固定资产盘点中,支持多种盘点方式(资产清查盘点)