git is blocked, how to install npm modules

We are connected thru a proxy and here, git is blocked ( not the website but on git//: ) we tried with egit, "git on windows", with and without proxy but not a single clone to local happened.

Now the problem is to install npm modules, i tried by downloading modules(zip) from git website (over web) and tried the local install, which worked but the problem here is huge number of dependencies, it is not easy to pull modules one by one to fill dependencies (and inner dependencies).

So how to solve this problem, I feel there can be three ways to find solution

  • Allowing git tunneling through firewall (i have no friends in n/w team )
  • Suggest me some way to pull modules with dependencies over http:// (and not git://) when doing npm install
  • Download from git website modules + full dependencies, in single shot.

Copied from this answer http://stackoverflow.com/a/10729634/1095114


If this is an issue with your firewall blocking the git: protocol port (9418), then you should make a more persistent change so you don't have to remember to issue commands suggested by other posts for every git repo. This also just works for submodules that might be using the git:// protocol too.

Simply issue the following command:

git config --global url."https://".insteadOf git://

This simply adds the following two lines to ~/.gitconfig:

[url "https://"] insteadOf = git://

Now, as if by magic, all git commands will perform a substitution of git:// to https://

Npm and git do not use your Windows proxy settings.

You can configure them with

set HTTP_PROXY=http://user:pass@server.url:port

Also see http://superuser.com/questions/347476/how-to-install-npm-behind-authentication-proxy-on-windows


If you can't get your proxy working you can run npm install on a machine that has a direct internet connection (e.g. a server in the dmz, at your hosting provider, in the cloud, etc.) and then copy the node_modules folder to your local machine.