package.json
{
"type": "module",
"name": "demo",
"version": "1.0.0",
"main": "main.js",
"scripts": {
"start": "chcp 65001 && electron .",
"dev": "chcp 65001 && nodemon --exec electron ."
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"devDependencies": {
"electron": "^32.0.1"
}
}
注
chcp 65001
chcp(Change Code Page) 用于改变活动控制台窗口的代码页,
65001 是 UTF-8 编码的代码页编号
npm start (start是npm中被预定义为运行项目的入口脚本)
npm run dev (dev并不是npm预定义的脚本)