-
Notifications
You must be signed in to change notification settings - Fork 34
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
Mimosa mod:list not working behind Proxy #293
Comments
Probably should use |
I was just thinking, you could grab the proxy from with "npm config get proxy" and use it like this in a http-request You could either cache the proxy or read it everytime. |
Can you try something for me? In a folder run Then pull in this code: https://gist.github.com/dbashford/a7b30f8743354dd47cb1, toss it in What do you get? |
I got the following response: {pathToNode}\node>node test.js TypeError: Cannot read property 'statusCode' of undefined Edit: What do you think about my solution? |
I'd have to see how that solution worked. Unfortunately I'm not behind a proxy so it would be hard for me to code and test properly. What does |
{pathToNode}\node>npm config get proxy You have to set this accordingly to this: It defaults to HTTP_PROXY (http_proxy), but can be set specifically (for Windows restricted cases, for example). |
To be honest, the best option is to just build a web app that showcases the modules rather than have a command for it. I'd either nuke the command or have the command just launch the app in their default browser. I just haven't gotten around to that. Given that the modules are listed on the website and that I'd rather have a specific UI for this as the final solution, I'm reluctant to take this on. I'd merge it as a PR, but if I were to address this right now I'd rather place some proper error messaging in to catch this case (and redirect to the list on the website) and wait until I get time for the other solutions. |
I didn't quite understand my ToDo in here. The thing you have to care about in your modules are the proxies that the user may want to use. In either case, "npm config get proxy" and "npm config get https-proxy" return the protocol, the IP (or domain) and the port (can contain user/password as well). It should be wrapped in a regex and be split accordingly. I think having a command is good too, you could even support paging. (I am a fan of cli) |
Is there any news on this? It's good that you noticed the users about this problem for starters. But I am still wondering, if you could grab the response to "npm config get proxy" and run a regex over it, so you extract the required data that you fill in optionally into the request options. |
This fix will get slotted from a priority perspective behind some other things I'm doing right now. I understand what you are explaining. I'd love to see an example of someone using this method to solve this problem since I feel like the problem is one you'd encounter often. |
Here is the update. This is a small gist I used to read npm configuration and read all of your modules. This gist is tested behind a corporate proxy. Edit2: I fixed the problem with linefeed after stdout. |
Mimosas mod:list doesn't work behind proxy and returns following error:
node\node_modules\mimosa\node_modules\mimosa-bower\node_modules\bow
er\node_modules\tmp\lib\tmp.js:261
throw err;
^
Error: connect ENETUNREACH
at errnoException (net.js:901:11)
at Object.afterConnect as oncomplete
Hower, using mimosa mod:install xyz you can still install modules.
I already set NPM proxy with npm config set (https-)proxy & github-proxy using the gitconfig-file.
The text was updated successfully, but these errors were encountered: