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