简体   繁体   中英

How can I install electronjs on Ubuntu from behind a proxy?

I have tried to install electronjs several times but I have not been able, I am behind a proxy and each attempt has returned the following error

> 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

Try this command:

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

Check this thread for more information and the original source.

I solved the problem by changing the connected wifi.network. I shared the mobile data with my computer and "npm i electron" worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM