1,出现以下报错:
Error: Unresolved node modules: vue, vuex, vue-class-component...
可能你的node_modules使用的是cnpm install安装的。删除node_modules,用yarn install重新安装。并且项目目录不能有中文路径。
2,运行时在此卡住不运行了怎么办:
• electron-builder version=20.44.4
• loaded configuration file=package.json ("build" field)
• writing effective config file=build\builder-effective-config.yaml
• rebuilding native production dependencies platform=win32 arch=x64
• packaging platform=win32 arch=x64 electron=2.0.18 appOutDir=build\win-unpacked
�[34m • �[0mdownloading �[34mparts�[0m=8 �[34msize�[0m=51 MB �[34murl�[0m=https://github.com/electron/electron/rele
ases/download/v2.0.18/electron-v2.0.18-win32-x64.zip
�[34m • �[0minterrupt: canceling...
试着翻墙后,还是卡在这个地方,没跑下去。
复制提示的链接手动下载
https://github.com/electron/electron/rele
ases/download/v2.0.18/electron-v2.0.18-win32-x64.zip
下载后下来的文件放到C:\Users\Administrator\AppData\Local\electron\Cache。目录下。
3,继续出现没运行下去的链接:
• electron-builder version=20.44.4
• loaded configuration file=package.json ("build" field)
• writing effective config file=build\builder-effective-config.yaml
• rebuilding native production dependencies platform=win32 arch=x64
• packaging platform=win32 arch=x64 electron=2.0.18 appOutDir=build\win-unpacked
�[34m • �[0mdownloading �[34mparts�[0m=1 �[34msize�[0m=5.6 MB �[34murl�[0m=https://github.com/electron-userland/ele
ctron-builder-binaries/releases/download/winCodeSign-2.4.0/winCodeSign-2.4.0.7z
�[34m • �[0mdownloaded �[34mduration�[0m=50m25.398s �[34murl�[0m=https://github.com/electron-userland/electron-bui
lder-binaries/releases/download/winCodeSign-2.4.0/winCodeSign-2.4.0.7z
同样的手动下载后拷贝到C:\Users\Administrator\AppData\Local\electron\Cache下,该操作有四步,全部下载后就可以打包了。(注意三个文件需要解压并放入对应的文件命名目录下)如下图:
打包成功:
4,打包后的阿里图标没显示
修改路径:
5,打包后托盘小图标找不到
把图标放到static目录下: