安装electron js的问题

hec6srdp  于 2023-10-14  发布在  Electron
关注(0)|答案(1)|浏览(189)

我正在尝试在node 18 lts和npm 10中安装electronjs。但是我得到了这个错误。

PS C:\Users\Administrator.GWNR71517\Desktop\electron> npm install electron --save-dev
npm ERR! code 1
npm ERR! path C:\Users\Administrator.GWNR71517\Desktop\electron\node_modules\electron
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node install.js
npm ERR! RequestError: read ECONNRESET
npm ERR!     at ClientRequest.<anonymous> (C:\Users\Administrator.GWNR71517\Desktop\electron\node_modules\got\dist\source\core\index.js:970:111)
npm ERR!     at Object.onceWrapper (node:events:632:26)
npm ERR!     at ClientRequest.emit (node:events:529:35)
npm ERR!     at origin.emit (C:\Users\Administrator.GWNR71517\Desktop\electron\node_modules\@szmarczak\http-timer\dist\source\index.js:43:20)
npm ERR!     at TLSSocket.socketErrorListener (node:_http_client:501:9)
npm ERR!     at TLSSocket.emit (node:events:517:28)
npm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)
npm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm ERR!     at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)

npm ERR! A complete log of this run can be found in: C:\Users\Administrator.GWNR71517\AppData\Local\npm-cache\_logs\2023-10-02T17_54_10_674Z-debug-0.log

我试着访问官方文档,但它不起作用

3bygqnnd

3bygqnnd1#

在几乎所有情况下,这些错误都是网络问题的结果,而不是电子npm软件包的实际问题。ELIFECYCLE、EAI_AGAIN、EIFECYCLE和ETIMEDOUT等错误都是此类网络问题的指示。最好的解决方案是尝试切换网络,或者稍等片刻,然后再次尝试安装。
从文件上。我会尝试通过下载发行版直接安装electron:
https://github.com/electron/electron/releases
否则,请尝试文档中的解决方案:https://github.com/electron/electron/blob/HEAD/docs/tutorial/installation.md
在较慢的网络上,建议使用--verbose标志来显示下载进度:
npm install --verbose electron

相关问题