侧边栏壁纸
博主头像
学海无涯博主等级

有疑问可发邮件[email protected]

  • 累计撰写 326 篇文章
  • 累计创建 85 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

RequestError: connect ETIMEDOUT 20.205.243.166:443

利刃
2022-08-31 / 0 评论 / 0 点赞 / 17 阅读 / 2549 字
温馨提示:
本文最后更新于 2024-08-13,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

描述

在安装electron时出现以下报错:
PS D:\dev\electron> yarn add electron concurrently cross-env electron-builder -D
yarn add v1.22.19
info No lockfile found.
[1/4] Resolving packages...
warning electron-builder > app-builder-lib > [email protected]: Please use @electron/osx-sign moving forward. Be aware the API is slightly different
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error D:\dev\electron\node_modules\electron: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: D:\dev\electron\node_modules\electron
Output:
RequestError: connect ETIMEDOUT 20.205.243.166:443
at ClientRequest.<anonymous> (D:\dev\electron\node_modules\got\source\request-as-event-emitter.js:178:14)
at Object.onceWrapper (node:events:628:26)
at ClientRequest.emit (node:events:525:35)
at origin.emit (D:\dev\electron\node_modules\@szmarczak\http-timer\source\index.js:37:11)
at TLSSocket.socketErrorListener (node:_http_client:494:9)
at TLSSocket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
 

解决方式

20.205.243.166该地址是github的地址,由于在国内无法访问。 方式一: 比如更改主机host,访问github。 方式二: 更改electron安装源。 yarn设置:
yarn config set electron_mirror https://npmmirror.com/mirrors/electron/
  npm设置
npm config set ELECTRON_MIRROR https://npmmirror.com/mirrors/electron/
  以下为官方说明: image

2022-8-31 15:12:41

0
  1. 支付宝打赏

    qrcode alipay
  2. 微信打赏

    qrcode weixin

评论区