microsoft / vscode-dts

CLI utility for downloading vscode.d.ts and vscode.proposed.d.ts
MIT License
34 stars 15 forks source link

### Environment #23

Closed xo89 closed 9 months ago

xo89 commented 9 months ago

Environment

Bug Summary and Steps to Reproduce

Bug Summary: On a laptop behind http proxy, yarn install fails at step postinstall

Steps to reproduce:

git clone https://github.com/Microsoft/vscode-cpptools.git
cd vscode-cpptools/Extension
export https_proxy=http://my_proxy:port
yarn install --proxy http://my_proxy:port

Expected behavior: Install success

Configuration and Logs

yarn install --proxy=http://127.0.0.1:8080
yarn install v1.22.19
[1/5] Validating package.json...
warning cpptools@1.14.4-main: The engine "vscode" appears to be invalid.
[2/5] Resolving packages...
[3/5] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
warning @vscode/extension-telemetry@0.6.2: The engine "vscode" appears to be invalid.
warning vscode-cpptools@6.1.0: The engine "vscode" appears to be invalid.
warning vscode-languageclient@8.1.0-next.4: The engine "vscode" appears to be invalid.
warning vscode-tas-client@0.1.27: The engine "vscode" appears to be invalid.
[4/5] Linking dependencies...
warning "@vscode/extension-telemetry > @microsoft/1ds-core-js > @microsoft/applicationinsights-core-js@2.8.4" has unmet peer dependency "tslib@*".
[5/5] Building fresh packages...
$ npm run download-api

> cpptools@1.14.4-main download-api
> vscode-dts dev

Downloading vscode.proposed.terminalDataWriteEvent.d.ts
To:   /home/jcq/workspace/vscode-cpptools/Extension/vscode.proposed.terminalDataWriteEvent.d.ts
From: https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDataWriteEvent.d.ts
Read more about proposed API at: https://code.visualstudio.com/api/advanced-topics/using-proposed-api
node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND raw.githubusercontent.com
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26)
Emitted 'error' event on ClientRequest instance at:
    at TLSSocket.socketErrorListener (node:_http_client:494:9)
    at TLSSocket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -3008,
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'raw.githubusercontent.com'
}


### Other Extensions

_No response_

### Additional context

This problem is caused by vscode-dts creates directly https request to `https://raw.githubusercontent.com` and doesn't use proxy setting in environment.

A pull request is already created to vscode-dts to solve this problem. Could some maintainer review this PR?
https://github.com/microsoft/vscode-dts/pull/14

_Originally posted by @Changqing-JING in https://github.com/microsoft/vscode-cpptools/issues/10631_