I'm trying to access the npm repository from an intranet using a proxy.
Using the proxy (set in the environment variables HTTP_Proxy and HTTPS_Proxy) I'm able to access the repository without ssl using my browser, and using wget:
wget registry.npmjs.org/yuidocjs
When I use https, I can access with my browser, but not with wget
wget https://registry.npm.js.org/yuidocjs #fails
When I try to use NPM, setting registry=http://registry.npm.js.org/ results in a 404.
When I use the default https registry path, it results in a timeout.
Anything I'm missing here? My config file looks like this:
proxy = http://ems-lnx222:8080/proxy.pac
https-proxy = http://ems-lnx222:8080/proxy.pac
registry = http://registry.npmjs.org/
prefix = /ws/bemccorm-rtp/npm-packages
strict-ssl = false
After some more playing I figured out that the .pac proxies seemed to be causing a problem.
I used a normal proxy instead, and now get a 200 status, GET the correct tgz file, and then receive an npm ERR! fetch failed when trying to fetch the file.
I am sure it was a typo but just to make it more clear for debugging.
When I use https, I can access with my browser, but not with wget
wget https://registry.npm.js.org/yuidocjs #fails
The domain was wrong... npm.JS instead of npmjs... Going further with wget
wget https://registry.npmjs.org/yuidocjs --2013-07-09 15:57:25-- https://registry.npmjs.org/yuidocjs Resolving registry.npmjs.org (registry.npmjs.org)... 67.228.31.146 Connecting to registry.npmjs.org (registry.npmjs.org)|67.228.31.146|:443... connected. ERROR: cannot verify registry.npmjs.org’s certificate, issued by “/C=US/ST=CA/L=Oakland/O=npm/OU=npm Certificate Authority/CN=npmCA/emailAddress=i@izs.me”: Unable to locally verify the issuer’s authority. To connect to registry.npmjs.org insecurely, use ‘--no-check-certificate’.
If you use --no-check-certificate it works and download.
But we know this is not your MAIN problem your Main problem is the .PAC files. I worked as a sysadmin and several times we have to write different rules at .pac files as: 1) If it is internal send everything to this router 2) If connected by vpn network do this 3) etc
So Please do a get and transcribe the .pac files so we can see the rules. The .pac files is nothing more than javascript.
Regards