electron-builder 在打包时编译sqlite3下载nsis winCodeSign超时问题
开始是用yarn打包sqlite3编译出错,使用npm就可以了
后面又是winCodeSign超时
我是真的无语啊,打个包打了一个上午都没成功。
问题如下:
electron-builder version=22.9.1 os=10.0.19042
• description is missed in the package.json appPackageFile=G:\_personal\lasa-project-client\dist_electron\bundled\package.json
• author is missed in the package.json appPackageFile=G:\_personal\lasa-project-client\dist_electron\bundled\package.json
• writing effective config file=dist_electron\builder-effective-config.yaml
• rebuilding native dependencies dependencies=sqlite3@5.0.0 platform=win32 arch=x64
• rebuilding native dependency name=sqlite3 version=5.0.0
• packaging platform=win32 arch=x64 electron=9.3.3 appOutDir=dist_electron\win-unpacked
• default Electron icon is used reason=application icon is not set
⨯ Get "https://github-releases.githubusercontent.com/65527128/f73f2200-5d53-11ea-8264-ddd345f11ee4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210716%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210716T015308Z&X-Amz-Expires=300&X-Amz-Signature=d1a508b2e0e7ed18229f10842c8a3cc105b83307d3e6750b81622f0713a91dab&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=65527128&response-content-disposition=attachment%3B%20filename%3DwinCodeSign-2.6.0.7z&response-content-type=application%2Foctet-stream": read tcp 172.17.7.151:64211->185.199.111.154:443: wsarecv: An existing connection was forcibly closed by the remote host.
网上说把Wincodesign下载下来放在C:\Users\zhangsan\AppData\Local\electron-builder\Cache下也是没用...
直到查到:设置.npmrc 自动下载
设置.npmrc
根目录下创建.npmrc文件.然后copy进去.
ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron/
ELECTRON_BUILDER_BINARIES_MIRROR=http://npm.taobao.org/mirrors/electron-builder-binaries/
然后打包就没啥问题了,你说奇怪不...
问题解决,参考资料:
https://segmentfault.com/a/1190000040356146