node-sass: Post Install fails inside a proxy
Dear all,
I am trying to install node-sass inside a proxy properly configured in node npm via
npm config set proxy http://myproxy.com:8080
all dependencies works but the post install of node-sass fails
npm info lifecycle node-sass@3.5.1~install: node-sass@3.5.1
node-sass@3.5.1 install D:\...\node_modules\node-sass
node scripts/install.js
Cannot download "https://github.com/sass/node-sass/releases/download/v3.5.1/win32-ia32-47_binding.node":
getaddrinfo ENOTFOUND github.com github.com:443
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
In the install.js script of the node-sass module, there is the proxy configuration reported below:
function applyProxy(options, cb) {
var env = process.env;
options.proxy = env.npm_config_https_proxy ||
env.npm_config_proxy ||
env.npm_config_http_proxy ||
env.HTTPS_PROXY ||
env.https_proxy ||
env.HTTP_PROXY ||
env.http_proxy;
cb(options);
}
the older versions (that work inside the proxy) are configured with the function as below
function applyProxy(options, cb) {
npmconf.load({}, function (er, conf) {
var proxyUrl;
if (!er) {
proxyUrl = conf.get('https-proxy') ||
conf.get('proxy') ||
conf.get('http-proxy');
}
var env = process.env;
options.proxy = proxyUrl ||
env.HTTPS_PROXY ||
env.https_proxy ||
env.HTTP_PROXY ||
env.http_proxy;
cb(options);
});
}
Thank You!
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 7
- Comments: 20 (9 by maintainers)
Commits related to this issue
- Revert removal on npmconf This reverts commit 5e21f47576b9d75859db71512decbaa9fc3ffca2. The solution implemented was not equivalent and resulted in issues for users with proxies. Fixes #1458 — committed to xzyfer/node-sass by xzyfer 8 years ago
- Revert "Replace "request" by "got"" This reverts commit c2d24c232529b89a2d37f82cd21a712b2c12e37b. Unfortunately got does not have good [proxy support][1] which was missed during review. Fixes #1458... — committed to xzyfer/node-sass by xzyfer 8 years ago
- Replace deprecated npmconf package. This was previously attempted in #1413. Shortly after it's release proxy users started experiencing installation issues so this was reverted. It was later determin... — committed to xzyfer/node-sass by xzyfer 8 years ago
- Replace deprecated npmconf package. This was previously attempted in #1413. Shortly after it's release proxy users started experiencing installation issues so this was reverted. It was later determin... — committed to xzyfer/node-sass by xzyfer 8 years ago
- Replace deprecated npmconf package. This was previously attempted in #1413. Shortly after it's release proxy users started experiencing installation issues so this was reverted. It was later determin... — committed to xzyfer/node-sass by xzyfer 8 years ago
- Replace deprecated npmconf package. This was previously attempted in #1413. Shortly after it's release proxy users started experiencing installation issues so this was reverted. It was later determin... — committed to xzyfer/node-sass by xzyfer 8 years ago
- Replace deprecated npmconf package. (#1492) This was previously attempted in #1413. Shortly after it's release proxy users started experiencing installation issues so this was reverted. It was late... — committed to sass/node-sass by xzyfer 8 years ago
- Merge pull request #1458 from drewwells/feature/renameToLength rename SIZE to LENGTH to avoid conflict with windows headers — committed to scantist-ossops-m2/node-sass by xzyfer 9 years ago
Anyone that ends up here might be intrested to know that
https://github.com/sass/node-sass/releases/download/v3.5.2/win32-ia32-47_binding.node
currently resolves togithub-cloud.s3.amazonaws.com
. So you may have to add exceptions to your corporate proxy accordinglyI believe I’ve found the issue. We recently our http library and the new open appears to have issues with proxies. I’ll revert this change and release v3.5.3 shortly.