如何从代理服务器后面在Ubuntu上安装electrojs



我试过几次安装electronjs,但都没能安装,我在代理后面,每次尝试都返回以下错误

> electron@10.1.5 postinstall /home/dipper/Development/my-electron-app/node_modules/electron
> node install.js
RequestError: getaddrinfo EAI_AGAIN github.com github.com:443
at ClientRequest.request.once.error (/home/dipper/Development/my-electron-app/node_modules/got/source/request-as-event-emitter.js:178:14)
at Object.onceWrapper (events.js:286:20)
at ClientRequest.emit (events.js:203:15)
at ClientRequest.origin.emit.args (/home/dipper/Development/my-electron-app/node_modules/@szmarczak/http-timer/source/index.js:37:11)
at TLSSocket.socketErrorListener (_http_client.js:401:9)
at TLSSocket.emit (events.js:198:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
npm WARN enoent ENOENT: no such file or directory, open '/home/dipper/Development/my-electron-app/package.json'
npm WARN my-electron-app No description
npm WARN my-electron-app No repository field.
npm WARN my-electron-app No README data
npm WARN my-electron-app No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@10.1.5 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the electron@10.1.5 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/dipper/.npm/_logs/2020-11-10T17_15_33_463Z-debug.log

尝试此命令:

npx cross-env ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTPS_PROXY=<your proxy URL> npm install electron

有关详细信息和原始来源,请查看此线程。

我通过更改连接的wifi网络解决了这个问题。我将移动数据与我的计算机共享;npm i电子";工作。

最新更新