当前位置:网站首页>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
边栏推荐
- How to count fixed assets and how to generate an asset count report with one click
- laravel-admin时间范围选择器dateRange默认值问题
- 配电房远程综合监控系统在10kV预制舱项目中的应用
- MQ is easy to use in laravel
- Summary of convolution layer and pooling layer
- 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
- Docker MySQL master-slave backup
- map<QString, bool> 的使用记录
- Usage of rename in cygwin
- Link sorting of tutorials such as assembly language running environment setting
猜你喜欢

讯飞2021年营收183亿:同比增41% 净利为15.56亿

MySQL Router重装后重新连接集群进行引导出现的——此主机中之前已配置过的问题

Yunna | how to manage the company's fixed assets and how to manage fixed assets

nacos基础(7):配置管理

MQ在laravel中简单使用

解读机器人编程课程的生物认知度

分享两个实用的shell脚本

年度最尴尬的社死瞬间,是Siri给的

Exploring the equipment and teaching of robot education
![抓包整理————tcp 协议[八]](/img/ae/4957a997af725a1bf3f61cb24fc717.png)
抓包整理————tcp 协议[八]
随机推荐
Database design of forum system
Using Baidu PaddlePaddle EasyDL to accomplish specified target recognition
MySQL failed to insert the datetime type field without single quotation marks
docker MySQL主从备份
Siri gave the most embarrassing social death moment of the year
MySQL8. 0 upgraded stepping on the pit Adventure
How does QT turn qwigdet into qdialog
Write console script by laravel
初探 Lambda Powertools TypeScript
得物技术网络优化-CDN资源请求优化实践
Solve the problem of "suncertpathbuilderexception: unable to find valid certification path to requested target"
nacos基础(6):nacos配置管理模型
laravel-admin时间范围选择器dateRange默认值问题
redis优化系列(二)Redis主从原理、主从常用配置
少儿编程结构的改变之路
Nacos Foundation (7): Configuration Management
Analyze the rules for the use of robots with good performance
Yunna | how to manage the company's fixed assets and how to manage fixed assets
Redis学习之五---高并发分布式锁实战
Interpreting the art created by robots