request/tunnel-agent

Error: vscode-ripgrep@0.0.11 postinstall: `node ./dist/postinstall.js`

Opened this issue · 0 comments

Hello,

I've had problems building VSCode behind the HTTP+HTTPS proxy related to tunnel-agent, details here: microsoft/vscode#24805

Summary of the problem:

I managed to debug the issue - it seems like tunnel-agent expects request options to contain references to .host and .port directly at top dictionary level while somehow in current vscode npm modules options has it wrapped into a contained host dictionary:

{
  "host": {
    "_defaultAgent": {
      "domain": null,
      "_events": {},
      ...

Changing file vscode\node_modules\tunnel-agent\index.js, function createSocket from:

, path: options.host + ':' + options.port

to

, path: options.host.host + ':' + options.host.port

and in createSecureSocket from:

{ servername: options.host

to

{ servername: options.host.host

fixed the issue, after that npm install vscode-ripgrep@0.0.11 worked without a problem.

To reiterate, this only happens behind http+https proxy. I've built vscode at home while not behind the proxy and it all worked without a hitch.