electron桌面开发相关注意点

electron的部署以及配置
如果使用的是pnpm,请先配置一下镜像,否则会安装失败的:

pnpm config set registry=https://registry.npmmirror.com
pnpm config set electron_mirror=https://cdn.npmmirror.com/binaries/electron/
pnpm config set electron_builder_binaries_mirror=https://npmmirror.com/mirrors/electron-builder-binaries/

如果是npm,其实也一样的,

npm config set registry=https://registry.npmmirror.com
npm config set electron_mirror=https://cdn.npmmirror.com/binaries/electron/
npm config set electron_builder_binaries_mirror=https://npmmirror.com/mirrors/electron-builder-binaries/

不过你也有另外一个选择:
在这里插入图片描述

添加
.npmrc文件,内容如下:

registry=https://registry.npmmirror.com
electron_mirror=https://cdn.npmmirror.com/binaries/electron/
electron_builder_binaries_mirror=https://npmmirror.com/mirrors/electron-builder-binaries/

你可能感兴趣的:(electron,javascript,前端)