MENU

electron拉取问题:read ETIMEDOUT

April 7, 2022 • 折腾

前言

今天重新拉一下项目里node_module依赖的时候,崩了。虽然用了一个多季度的MacOS,整个开发环也基本没啥大问题。但还是出现了以下的问题。

error /Users/dextercai/project/sct_helper/node_modules/electron: Command failed.
Exit code: 1
Command: node install.js
Arguments: 
Directory: /Users/dextercai/project/sct_helper/node_modules/electron
Output:
RequestError: read ETIMEDOUT
    at ClientRequest.<anonymous> (/Users/dextercai/project/sct_helper/node_modules/got/source/request-as-event-emitter.js:178:14)
    at Object.onceWrapper (events.js:422:26)
    at ClientRequest.emit (events.js:327:22)
    at ClientRequest.origin.emit (/Users/dextercai/project/sct_helper/node_modules/@szmarczak/http-timer/source/index.js:37:11)
    at TLSSocket.socketErrorListener (_http_client.js:469:9)
    at TLSSocket.emit (events.js:315:20)

快速解决

代理太慢,换国内源。分别需要换Yarn/npm以及electron。

export ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/

npm config set registry http://registry.npm.taobao.org/
//npm config set registry https://registry.npmjs.org/

yarn config set registry https://registry.npm.taobao.org
//yarn config set registry https://registry.yarnpkg.com

即日起关闭全站评论区,您可以通过关于页面的电邮地址和我取得联系,谢谢

Archives QR Code
QR Code for this page
Tipping QR Code