win10下的electron的环境配置


electron安装之前需要安装node.js,本文主要通过npm的方式安装

替换淘宝npm

由于npm的服务器在国外,速度比较慢,而且有时会出现一些下载不成功出现的错误,这里选用淘宝的npm,替换命令如下:

npm install -g cnpm --registry=https://registry.npm.taobao.org

通过注册cnpm实现替换,以后安装就可以通过cnpm进行,而不用npm

安装electron

cnpm install -g electron

安装electron的打包工具

cnpm install -g electron-packager

测试electron

这里通过github一个quickapp进行测试electron,你可以在github上搜索electron-quick-start项目,作为你的第一个demo,使用方法如下:

# Clone this repository
git clone https://github.com/electron/electron-quick-start
# Go into the repository
cd electron-quick-start
# Install dependencies
npm install
# Run the app
npm start

此时你就会看到一个hello world的窗口,可以使用html/css/js方式构建桌面应用,想想都觉得是一件很酷的事情。


免责声明!

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



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