# 设置淘宝镜像
npm config set registry https://registry.npmmirror.com/ -g
# electron、electron-builder 安装失败
# 设置变量原因:
# .\node_modules\@electron\get\dist\cjs
# .\node_modules\app-builder-lib\out\binDownload.js
npm config set ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
npm config set ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/
# 查看npm运行报错日志
%appdata%\npm-cache\_logs
# 还原npm镜像地址
通过npm config list查看npmrc文件路径,通过del删除
# 安装asar
npm install -g asar
# 将app.asar解包到app文件夹
asar extract app.asar app
# 将app文件夹打包成app.asar
asar pack app app.asar
nodejs
于 2022-03-15 22:48:24 首次发布