Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NCU does not appear to respect NPMs proxy settings #1069

Open
3 tasks done
shadow7412 opened this issue Mar 10, 2022 · 8 comments
Open
3 tasks done

NCU does not appear to respect NPMs proxy settings #1069

shadow7412 opened this issue Mar 10, 2022 · 8 comments

Comments

@shadow7412
Copy link

  • I have searched for similar issues
  • I am using the latest version of npm-check-updates
  • I am using node >= 12

Steps to Reproduce

Set up a proxy, and configure NPM to use it.

Current Behavior

The network traffic NCU uses to verify the status of packages does not go through the proxy (and fails completely when using said proxy is necessary to get to the internet)

Expected Behavior

NCU should respect NPMs proxy configuration, and successfully make calls via the prroxy.

@raineorshine
Copy link
Owner

raineorshine commented Mar 10, 2022

Thanks for reporting. Can you clarify exactly which npm config variables are set for your proxy configuration? That will help ensure I am testing the same setup.

Also, once I do set up a proxy on my machine to test, any tips on how to tell whether it is being used or not? I don't have experience in this area.

@shadow7412
Copy link
Author

shadow7412 commented Mar 10, 2022

The command I used (with redactions) to enable the proxy is as follows;

npm config --global set proxy http://PROXY_URL:PROXYPORT

The easiest way to see if the proxy is being used is probably going to be by that p;roxy's logs I think. You should be able to turn on verbose logging. Once you have, you should see every expected URL come up in the logs. Any missing ones presumably aren't going through the proxy.

A proxy that definitely supports these kinds of logs on windows is privoxy, if that helps.

@raineorshine
Copy link
Owner

I tried to sign up for a free trial of a proxy server, but it didn't work for me. I'm sure there is something out there that will work, but it's not something I can put more time into right now. If you can provide me with a proxy server for testing purposes I'm willing to take another stab at it. Otherwise you might be the best person to troubleshoot and submit a PR.

@shadow7412
Copy link
Author

I mentioned Privoxy in the previous message - did that not work for you?

@raineorshine
Copy link
Owner

I thought it was Windows-only based on your comment, but I see that it is also for MacOS. I'll give it a try and see how far I get.

@raineorshine
Copy link
Owner

I was able to install Privoxy on OSX, but it's not exactly user friendly. https://www.privoxy.org/config/ says it's not enabled, and p.p says it is. I'm not sure which is correct. It does not log requests by default, and the config file is not where the documentation says it should be, so I'm not able to enable verbose logging.

If this was my day job, I might be more motivated to pursue this further. However, at this time I'm going to direct my attention elsewhere, though I am sympathetic to finding a fix. Please feel free to investigate on your own time, and I will be more than happy to provide direction for a PR.

@shadow7412
Copy link
Author

Totally fair.

@shadow7412
Copy link
Author

Ok, I had a poke around. The issue might be in pacote. I can see here that npmConfig is passed through, and I've verified that the proxy settings are present in the npmConfig object.

I might have to take this deeper :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants