-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ECONNREFUSED when using HTTPS over HTTP proxy #679
Comments
Hello, the salient error is This is a (temporary?) network problem connecting to bintray (within China?) to retrieve the pre-compiled binary of libvips and its dependencies. |
I don't think it's a network problem, because I get the same error message but I can still download the file with curl. |
@mirow |
I'm not using a proxy |
dl.bintray.com retuns a 302 redirect, is that the problem? |
@mirow I experience no 302 redirects locally:
The IP address I'm being served for
The IP address in the original error report is:
which suggests some kind of DNS poisoning or MITM. |
Nevermind, my reason was different (glibc version) even though the error message was the same |
I am in china .my macbook ok,windows ok,test server is centos 7.2 no ok. HTTP/1.1 200 OK |
@wangzhiwei1888 The double HTTP in the response suggests there's a proxy involved here.
Perhaps this is attempting to tunnel HTTPS over HTTP? Does the following make any difference? NODE_TLS_REJECT_UNAUTHORIZED=0 npm install sharp |
my company test service can not to connect web ,must proxy to one service . is the reason? |
@wangzhiwei1888 Yes, very likely. sharp depends on get-proxy to find it. Perhaps check the proxy is capable of proxying HTTPS connections? |
but is ok |
this is https |
@wangzhiwei1888 Please can you provide the output of the following commands when run on the machine that is failing to proxy:
|
[root@infra-wordpress node-generator-img-activity]# env | grep -i proxy |
@wangzhiwei1888 Thank you. I suspect the problem here is the HTTPS proxy being via a non-TLS HTTP connection. Are you able to make the following change to binding.js#L101 and test locally? - const gotOpt = {};
- if (process.env.npm_config_https_proxy) {
- // Use the NPM-configured HTTPS proxy
- gotOpt.agent = caw(process.env.npm_config_https_proxy);
- }
+ const agent = caw(null, { protocol: 'https' });
+ const gotOpt = { agent: agent }; |
sorroy , i dont know . |
Sorry for the confusion. Please can you try making your project's ...
"dependencies": {
"sharp": "lovell/sharp#https-over-http"
},
... |
thank you very match . the question is solved. welcome to china . |
@wangzhiwei1888 Thank you for confirming. This addition will be included in v0.17.1. |
sharp v0.17.1 now available. |
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/6.9.4"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/opt/yrd_app/node-generator-img-activity/node_modules/sharp/.node-gyp"
ERROR: Download of https://dl.bintray.com/lovell/sharp/libvips-8.4.2-linux-x64.tar.gz failed: connect ECONNREFUSED 35.166.56.1:443
gyp: Call to 'LDD_VERSION="ldd (GNU libc) 2.17
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
由 Roland McGrath 和 Ulrich Drepper 编写。" node -e "require('./binding').download_vips()"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error:
gyp
failed with exit code: 1gyp ERR! stack at ChildProcess.onCpExit (/root/work/node-v6.9.4-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 3.10.0-327.22.2.el7.x86_64
gyp ERR! command "/root/work/node-v6.9.4-linux-x64/bin/node" "/root/work/node-v6.9.4-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/yrd_app/node-generator-img-activity/node_modules/sharp
gyp ERR! node -v v6.9.4
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Linux 3.10.0-327.22.2.el7.x86_64
npm ERR! argv "/root/work/node-v6.9.4-linux-x64/bin/node" "/root/work/node-v6.9.4-linux-x64/bin/npm" "install" "--registry=https://registry.npm.taobao.org"
npm ERR! node v6.9.4
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install:
node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
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 sharp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs sharp
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls sharp
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /opt/yrd_app/node-generator-img-activity/npm-debug.log
The text was updated successfully, but these errors were encountered: