npm 安装 由于网络等原因失败 改用淘宝镜像也不行
组后使用yarn 安装成功 但是打包出问题 是由于安装的时候缺少东西
最后成功的方法
、安装yarn
npm install -g yarn 或 cnpm install -g yarn
2、yarn 设置淘宝源
yarn config set registry https://registry.npm.taobao -g
yarn config set sass_binary_site http://cdn.npm.taobao/dist/node-sass -g
3、删除项目根目录 node_modules
4、使用命令 yarn 或 yarn install 重新安装依赖
5、yarn run build 重新打包
但是打包时出现错误Application entry file “dist\electron\main.js” in the “D:\electronWork\new-edu-001\build\win-unpacked\resources\app.asar” does not exist
解决方法:
yarn add multispinner -D
然后在.electron-vue/build.js 文件中添加一句
const Multispinner = require('multispinner')
打包由于网络原因会报
• packaging platform=win32 arch=x64 electron=2.0.18 appOutDir=build\win-unpacked
⨯ Get https://github/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.4.0/winCodeSign-2.4.0.7z: read tcp 192.168.16.131:53834->20.205.243.166:443: wsarecv: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
。。。
Error: E:\electron_workspace\electron-vue-app\node_modules\app-builder-bin\win\x64\app-builder.exe exited with code 1
at ChildProcess.<anonymous> (E:\electron_workspace\electron-vue-app\node_modules\builder-util\src\util.ts:244:14)
at Object.onceWrapper (events.js:483:26)
at ChildProcess.emit (events.js:376:20)
at maybeClose (internal/child_process.js:1055:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
From previous event:
at processImmediate (internal/timers.js:462:21)
多尝试几次就好了
参考自:https://www.jianshu/p/3d681539ac50
https://blog.csdn/qq_43548590/article/details/120021371
更多推荐
electron-vue 安装打包心得
发布评论