electron on win7:
0. win7
1. 下载node(stable version)安装包:
装在哪都行:
eg:
f:\lang\
2. npm(node安装后就有)
3. npm settings:
1. speed up npm in China:
npm config set registry=https://registry.npm.taobao.org
cd %userprofile%
note .npmrc
npm config set electron_mirror=http://npm.taobao.org/mirrors/electron/
2. storage path of npm:
npm config set prefix=f:\tool
win+pause, "adv system setting"-"advanced"-"env vars"-"system vars"-path:
C:\Windows\system32;前面加上f:\tool;
即:
f:\tool;C:\Windows\system32;
4. npm i -g electron
npm i -g electron-prebuilt
npm i -g electron-packager
5. electron项目开发:
1. github.com站内搜索 electron:
1. 里面有些electron例子
2. 下载下来测试下:
1. cmd中cd/d e:\ &mkdir work &cd/d work
2. git clone https://github.com/xxxxxxx.git
3. ...
2. ...
6. package.json 配置:
{
"name": "asd",
"version": "0.1.0",
"main": "main.js",
"scripts": {
"start": "electron ."
,"pack:all" :
"electron-packager . asd --all --out ../OutApp --version 1.4.15 --overwrite --icon=./_pic/icon.ico"
,"pack:win" :
"electron-packager . asd --platform=win32 --arch=ia32 --out ../OutApp --version 1.4.15 --overwrite --icon=./_pic/icon.ico"
,"pack:mac" :
"electron-packager . asd --platform=darwin --arch=x64 --out ../OutApp --version 1.4.15 --overwrite --icon=./_pic/icon.ico --sign='icon_global Application: iCON Global'"
}
,"description": "electron version of asd"
,"dependencies": {
"async": "^2.1.4"
}
,"comments": {
"request": "^2.79.0"
,"gulp": "^3.9.1"
,"bearcat": "^0.4.29"
,"electron-packager": "^8.4.0"
,"electron-prebuilt": "^1.4.13"
},
"keywords": [
"asd",
"electron"
],
"author": "dsa",
"license": "ISC"
}
7. 在项目的主package.json所在目录下:
右键-refresh
shift+右键,w:
打开cmd后:
npm run pack:win
8. 在刚才提到的 OutApp目录中 就能看到生成的东西了
9. 临时这么写个教程, 有空再改进下