0%

electron安装

错误信息

1
2
3
4
5
6
7
8
9
10
11
12
13
error C:\Users\wlzaz\Desktop\Gitlab\vben-admin-electron\node_modules\electron: Co
Exit code: 1
Command: node install.js
Arguments:
Directory: C:\Users\wlzaz\Desktop\Gitlab\vben-admin-electron\node_modules\electro
Output:
RequestError: read ECONNRESET
at ClientRequest.<anonymous> (C:\Users\wlzaz\Desktop\Gitlab\vben-admin-electr
at Object.onceWrapper (node:events:646:26)
at ClientRequest.emit (node:events:538:35)
at ClientRequest.origin.emit (C:\Users\wlzaz\Desktop\Gitlab\vben-admin-electr
at TLSSocket.socketErrorListener (node:_http_client:442:9)
at TLSSocket.emit (node:events:526:28)

运行node install.js失败

分析错误原因 RequestError: read ECONNRESET 连接重置

这个原因大概率是因为被墙了

解决方案, 更换为国内源, 例如淘宝镜像

npm

1
npm config set ELECTRON_MIRROR http://npm.taobao.org/mirrors/electron/

yarn

1
yarn config set electron_mirror https://cdn.npm.taobao.org/dist/electron/

参考链接

https://www.talktocomputer.site/blogs/139/