Git克隆有效,但git fetch超时发生

时间:2015-07-03 03:57:38

标签: git github npm

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

"C:\Program Files (x86)\nodejs\npm.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:\Jenkins\jobs\AppServer-NodeJS-Modules\workspace\npm-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)\nodejs\npm.cmd" install --production --msvs_version=2013

为什么git clone工作正常,而git fetch无法连接到服务器?

1 个答案:

答案 0 :(得分:0)

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

希望有所帮助。