1.安装node.js
2.指定淘宝镜像
npm install -g cnpm -registry=https://registry.npm.taobao.org
3.创建项目文件夹
cnpm init 初始化项目
4.安装electron
cnpm install --save-dev electron
将 main改成main.js script改成"start": "electron ."
{ "name": "my-app", "version": "1.0.0", "main": "main.js", "scripts": { "start": "electron ." }, "author": "", "license": "ISC", "description": "", "devDependencies": { "electron": "^22.0.0" } }
5.nmp start 启动项目
标签:npm,入门,cnpm,js,start,electron,操作,main
From: https://www.cnblogs.com/njcxwz/p/16987658.html