Git克隆可以工作,但发生Git获取超时



我正在配置Jenkins构建服务器,我只想这样做:

"C:Program Files (x86)nodejsnpm.cmd" install --production --msvs_version=2013

其中一个包是https://github.com/yaronn/xmldom.git/

运行npm install:时出现此错误消息

npm WARN package.json AppServer@1.18.0 No repository field.
npm WARN package.json AppServer@1.18.0 No README data
npm WARN package.json AppServer@1.18.0 No license field.
npm ERR! git fetch -a origin (https://github.com/yaronn/xmldom.git) fatal: unable to access 'https://github.com/yaronn/xmldom.git/': Failed to connect to github.com port 443: Timed out
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "C:\Program Files (x86)\nodejs\\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "--production" "--msvs_version=2013"
npm ERR! node v0.10.36
npm ERR! npm  v2.12.1
npm ERR! code 128
npm ERR! Command failed: fatal: unable to access 'https://github.com/yaronn/xmldom.git/': Failed to connect to github.com port 443: Timed out
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     D:JenkinsjobsAppServer-NodeJS-Modulesworkspacenpm-debug.log

我尝试在npm install命令之前添加git clone https://github.com/yaronn/xmldom.git/命令,xmldom已成功克隆到我的工作区中。

这是我的最后一个脚本:

git config --global http.proxy myproxy-here
git config --global https.proxy myproxy-here
git config --global url."https://".insteadOf git://
git clone https://github.com/yaronn/xmldom.git/
"C:Program Files (x86)nodejsnpm.cmd" install --production --msvs_version=2013

为什么gitclone工作正常,而gitfetch无法连接到服务器?

git fetch -a origin (https://github.com/yaronn/xmldom.git)

不是git命令。如果这是你在代码中使用的,那么你需要更改它

git remote add origin https://github.com/yaronn/xmldom.git
git fetch -a origin

希望能有所帮助。

最新更新