当从镜像克隆时,npm不尊重git的“insteadOf”configuration

我已经设置了以下命令来阻止npm使用GIT协议下载NPM软件包,因为它被我的服务器以某种方式阻止:

git config --global url."https://github.com/".insteadOf git@github.com 

但是,在运行npm install ,由于软件包尝试使用Git协议,在从镜像进行回购克隆的上下文中仍然会出现错误:

 npm ERR! git clone --template=/home/jenkins/.npm/_git-remotes/_templates --mirror git://github.com/isaacs/js-yaml.git /home/jenkins/.npm/_git-remotes/git-github-com-isaacs-js-yaml-git-dd3d7a8b: Cloning into bare repository '/home/jenkins/.npm/_git-remotes/git-github-com-isaacs-js-yaml-git-dd3d7a8b'... npm ERR! git clone --template=/home/jenkins/.npm/_git-remotes/_templates --mirror git://github.com/isaacs/js-yaml.git /home/jenkins/.npm/_git-remotes/git-github-com-isaacs-js-yaml-git-dd3d7a8b: npm ERR! git clone --template=/home/jenkins/.npm/_git-remotes/_templates --mirror git://github.com/isaacs/js-yaml.git /home/jenkins/.npm/_git-remotes/git-github-com-isaacs-js-yaml-git-dd3d7a8b: fatal: unable to connect to github.com: npm ERR! git clone --template=/home/jenkins/.npm/_git-remotes/_templates --mirror git://github.com/isaacs/js-yaml.git /home/jenkins/.npm/_git-remotes/git-github-com-isaacs-js-yaml-git-dd3d7a8b: github.com[0: 192.30.252.129]: errno=Connection refused 

我比较了安装到node_modules中的模块和package.json中声明的模块,唯一缺less的是grunt-contrib-nodeunit ,奇怪的是它不依赖于js-yaml …那么为什么它需要克隆它的回购呢? 无论如何,在指定镜像时是否有强制使用HTTPS的方法?

我能够解决这个使用(git://而不是git @)

 git config --global url."http://github.com".insteadOf git://github.com