felixrieseberg / windows-build-tools

:package: Install C++ Build Tools for Windows using npm
MIT License
3.4k stars 237 forks source link

tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 4145 #221

Closed Dam998 closed 4 years ago

Dam998 commented 4 years ago

Hi, I don't know why but get this error when execute npm i windows-build-tools -g :

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

> windows-build-tools@5.2.2 postinstall C:\Users\dpapi\AppData\Roaming\npm\node_modules\windows-build-tools
> node ./dist/index.js

Downloading python-2.7.15.amd64.msi
Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 4145
Downloading Python failed. Error: Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 4145
    at ClientRequest.onError (C:\Users\dpapi\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\tunnel-agent\index.js:177:17)
    at Object.onceWrapper (events.js:421:26)
    at ClientRequest.emit (events.js:314:20)
    at Socket.socketErrorListener (_http_client.js:469:9)
    at Socket.emit (events.js:314:20)
    at emitErrorNT (internal/streams/destroy.js:100:8)
    at emitErrorCloseNT (internal/streams/destroy.js:68:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  code: 'ECONNRESET'
}
windows-build-tools will now exit.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! windows-build-tools@5.2.2 postinstall: `node ./dist/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the windows-build-tools@5.2.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\dpapi\AppData\Roaming\npm-cache\_logs\2020-07-26T15_54_07_016Z-debug.log
jacobq commented 4 years ago
Downloading python-2.7.15.amd64.msi
Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 4145
Downloading Python failed. Error: Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 4145
   at ClientRequest.onError (C:\Users\dpapi\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\tunnel-agent\index.js:177:17)
   at Object.onceWrapper (events.js:421:26)
   at ClientRequest.emit (events.js:314:20)

This appears to be caused by a problem with your network. https://github.com/nodejs/node/issues/5436#issuecomment-188917703

What happens when you try to download the installer directly? e.g.

$ wget https://www.python.org/ftp/python/2.7.15/python-2.7.15.amd64.msi

You may want to try using a different Python mirror (e.g. --python-mirror argument or PYTHON_MIRROR environment variable).

Dam998 commented 4 years ago

Thank you for your support

the wget command doesn't work for me

I tried from another pc and this command: npm i windows-build-tools -g works, so the problem is only on my personal pc

How is it possible? what's can be the problem?

Dam998 commented 4 years ago

Hi, I solved it with this command: npm config delete proxy

I don't know why but now it's working all perfectly

Do you have any idea about what's up?

However thank you for your time and support!

jacobq commented 4 years ago

the wget command doesn't work for me

It's not included with Windows; you'd have to download and install it. I didn't mean to imply that you had to use that tool though. It's just a CLI HTTP/HTTPS/FTP client. You could've tried the URL in a standard web browser instead or performed just the DNS lookup portion using nslookup.

Do you have any idea about what's up?

It seems likely that your computer's proxy settings (or other network configuration) are not set correctly. It is unlikely to be related to windows-build-tools at all.