本文最后更新于 107 天前,如有失效请评论区留言。
Electron 下载失败解决方法
在安装Electron,使用命令
yarn add electron -D
报错
error E:\test\electron\node_modules\electron: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: E:\test\electron\node_modules\electron
Output:
RequestError: read ECONNRESET
at ClientRequest.<anonymous> (E:\test\electron\node_modules\got\dist\source\core\index.js:970:111)
at Object.onceWrapper (node:events:633:26)
at ClientRequest.emit (node:events:530:35)
at origin.emit (E:\test\electron\node_modules\@szmarczak\http-timer\dist\source\index.js:43:20)
at TLSSocket.socketErrorListener (node:_http_client:495:9)
at TLSSocket.emit (node:events:518:28)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
使用下面命令即可解决
yarn config set electron_mirror https://npmmirror.com/mirrors/electron/