简单安装测试Electron(官网)
# 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
打包Electron Builder
sudo npm i electron -g
sudo npm i electron-builder -g
打包Windows执行文件,需要下载wine
注意一定要用npm,不要用cnpm,因为需要下载electron-v8.2.5-linux-x64.zip
package.json
{
"name": "electron-quick-start",
"version": "1.0.0",
"description": "A minimal Electron application",
"main": "main.js",
"scripts": {
"start": "electron .",
"pack": "electron-builder --dir",
"dist": "electron-builder",
"dist:mac": "electron-builder --mac --x64 ",
"dist:win": "electron-builder --win --x64 ",
"dist:linux": "electron-builder --linux --x64 "
},
"repository": "https://github.com/electron/electron-quick-start",
"keywords": [
"Electron",
"quick",
"start",
"tutorial",
"demo"
],
"author": "LightBeam",
"license": "MIT",
"devDependencies": {
"electron": "^8.2.5"
}
}