nvm-windows icon indicating copy to clipboard operation
nvm-windows copied to clipboard

Setting proxy doesn't seem to work

Open jrgleason opened this issue 9 years ago • 9 comments

$ nvm proxy http://localhost:3128/
$ nvm proxy
Current proxy: none

?

jrgleason avatar Nov 18 '15 19:11 jrgleason

I also confirmed it did work on my old version of nvm and I also tried restarting all cygwin installs

jrgleason avatar Nov 18 '15 19:11 jrgleason

Did you try a proxy without NVM? This is all NVM really does in the background... shouldn't have anything to do with Cygwin.

coreybutler avatar Dec 22 '15 18:12 coreybutler

By that do you mean HTTP_PROXY? If so I did try it. I also use a proxy other places. Sorry I was away from this project for a while.

jrgleason avatar May 03 '16 17:05 jrgleason

I was asking if you had verified that the proxy worked, but in reviewing this, I'm seeing that really doesn't matter. The bigger question is why Current proxy: none is displayed. It should at least be showing Current proxy: http://localhost:3128/.

NVM just reads the settings file for the proxy, but defaults to none. This tells me your proxy is not being saved to settings.txt. There are a number of reasons why this could happen... the most common being lack of permission to write to the settings.txt file. It's also possible the separator could be causing the file path to fail since it is expecting a Windows \ instead of a unix /.

Also keep in mind this is designed for Windows users, not unix style users. It has been a long time since I've used Cygwin, and I don't recall whether it does any user masquerading or not (i.e. root instead of the windows user).

I suggest manually editing the settings.txt file to identify your proxy. That should at least allow you to start downloading node. If that works, check your permissions. If it doesn't work, there may be something else happening within Cygwin.

coreybutler avatar May 03 '16 18:05 coreybutler

The proxy does work with a caveat, HTTPS has to have strict set to false. The company uses a poorly configured cert.

jrgleason avatar May 03 '16 20:05 jrgleason

I will also double check the permissions issue soon.

jrgleason avatar May 03 '16 20:05 jrgleason

Honestly, I didn't account for self-signed SSL. That's something I will take a look at, even if it isn't the root of your problem. Let me know when you have results. I'm not terribly inclined to support Cygwin for two major reasons. First, the next version of NVM4W will be cross platform. Second, Windows adding bash support and a linux subkernal may make all of this moot. However; self-signed SSL certs and config issues should definitely be addressed.

coreybutler avatar May 03 '16 20:05 coreybutler

me too! But I'm using Windows 10, not Cygwin

pabrams avatar Dec 01 '21 23:12 pabrams

I had same problem, Windows 10:

c:\msuska\download>nvm version
1.1.10

c:\msuska\download>nvm proxy localhost:8080

c:\msuska\download>nvm proxy
Current proxy: none

c:\msuska\download>nvm list available

Could not retrieve https://nodejs.org/dist/index.json.


Get "https://nodejs.org/dist/index.json": dial tcp 104.20.22.46:443: i/o timeout

but this answer from SO solved it, in short you need to set the proxy as Administrator.

Martin-Suska avatar Feb 24 '23 12:02 Martin-Suska