electron / electron-quick-start

Clone to try a simple Electron app
https://electronjs.org/docs/latest/tutorial/quick-start
Creative Commons Zero v1.0 Universal
11.13k stars 4.93k forks source link

Issues with install due to PROXY #150

Closed cmpsoares91 closed 7 years ago

cmpsoares91 commented 7 years ago

Hello I'm trying to perform npm install but this is giving me a connection error:

C:\path\to\project\electron-quick-start>npm install electron -g
C:\tools\nodejs\node-v7.9.0-win-x64\electron -> C:\tools\nodejs\node-v7.9.0-win-x64\node_modules\electron\cli.js

> electron@1.6.6 postinstall C:\tools\nodejs\node-v7.9.0-win-x64\node_modules\electron
> node install.js

C:\tools\nodejs\node-v7.9.0-win-x64\node_modules\electron\install.js:47
  throw err
  ^

Error: getaddrinfo ENOTFOUND github.com github.com:443
    at errnoException (dns.js:28:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:73:26)
npm WARN Error: EPERM: operation not permitted, lstat 'C:\tools\nodejs\node-v7.9.0-win-x64\node_modules\electron\node_modules\concat-stream\node_modules'
npm WARN  { Error: EPERM: operation not permitted, lstat 'C:\tools\nodejs\node-v7.9.0-win-x64\node_modules\electron\node_modules\concat-stream\node_modules'
npm WARN   errno: -4048,
npm WARN   code: 'EPERM',
npm WARN   syscall: 'lstat',
npm WARN   path: 'C:\\tools\\nodejs\\node-v7.9.0-win-x64\\node_modules\\electron\\node_modules\\concat-stream\\node_modules' }
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\tools\\nodejs\\node-v7.9.0-win-x64\\node.exe" "C:\\tools\\nodejs\\node-v7.9.0-win-x64\\node_modules\\npm\\bin\\npm-cli.js" "install" "electron" "-g"
npm ERR! node v7.9.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! electron@1.6.6 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron@1.6.6 postinstall script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs electron
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls electron
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\MyUser\AppData\Roaming\npm-cache\_logs\2017-05-02T13_31_02_483Z-debug.log

C:\path\to\project\electron-quick-start>

To contextualise we're in a corporate workspace which is under firewall and proxy configurations, thus I've configured our nexus server as the npm registry (it's proxying it and works fine). However, when I try to install the electron dependency it crashes with the error mentioned above.

I have tried some proxy configurations but I don't know why it did not work, I would like to instead try to understand why Electron is trying to reach Github and if it is possible to work around it and work only with the NPM repo?

Best regards, Carlos Soares.

ghost commented 7 years ago

I have just come across this too, using yarn to install rather than npm, but the same error.

$ yarn
yarn install v0.23.4
info No lockfile found.
   .........
error C:\Data\Node\electron-quick-start\node_modules\electron: Command failed.
Exit code: 1
Command: C:\Windows\system32\cmd.exe
Arguments: /d /s /c node install.js
Directory: C:\Data\Node\electron-quick-start\node_modules\electron
Output:
C:\Data\Node\electron-quick-start\node_modules\electron\install.js:47
  throw err
  ^

Error: connect ECONNREFUSED 192.30.253.113:443
    at Object.exports._errnoException (util.js:1050:11)
    at exports._exceptionWithHostPort (util.js:1073:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1093:14)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this
command.
ghost commented 7 years ago

Please re run the install command with --verbose

zeke commented 7 years ago

You need to configure your proxy to allow connections to github.com

ghost commented 7 years ago

@zeke that's not the most helpful response - I believe most people running into this issue won't have the admin powers required to make changes to the proxy itself. Better to work out what the missing git, npm or node config settings are.

zeke commented 7 years ago

@voltagex sorry for the brevity. @cmpsoares91 without knowing the particulars of your network setup, the best thing I can recommend is to run npm install while connected to a network that can access github.com and npmjs.com.

myfrndjk commented 6 years ago

Hi,

I am also facing same issue in my build environment. Is there any solution for this problem. I have no idea about that build host the only info i know about the host is it is linux. Dont have any admin rights on that host.

Thanks Jk