【问题】
参考:
去在cygwin中使用git去安装npm,结果错误:
CLi@PC-CLI-1 /cygdrive/d/tmp/tmp_dev_root/node.js/npm $ git clone --recursive git:/github.com/isaacs/npm.git Cloning into 'npm'... ssh: connect to host git port 22: Connection timed out fatal: The remote end hung up unexpectedly
其中cygwin中git的信息:
CLi@PC-CLI-1 ~ $ which git /usr/bin/git CLi@PC-CLI-1 ~ $ where git D:\tmp\tmp_dev_root\cgwin\bin\git.exe CLi@PC-CLI-1 ~ $ git --version git version 1.7.9
【解决过程】
1.使用浏览器,无法打开:
git:/github.com/isaacs/npm.git
2.使用浏览器,可以打开:
http:/github.com/isaacs/npm.git
跳转到:
网站上看到了Read-Only的链接为:
https://github.com/isaacs/npm.git
所以重新去试试:
git clone –recursive https://github.com/isaacs/npm.git
结果是可以正常clone下来的:
CLi@PC-CLI-1 /cygdrive/d/tmp/tmp_dev_root/node.js/npm $ git clone --recursive https://github.com/isaacs/npm.git Cloning into 'npm'... remote: Counting objects: 22128, done. remote: Compressing objects: 100% (6426/6426), done. remote: Total 22128 (delta 15978), reused 21536 (delta 15450) Receiving objects: 100% (22128/22128), 6.56 MiB | 192 KiB/s, done. Resolving deltas: 100% (15978/15978), done.
【总结】
貌似,cygwin中的git客户端,无法识别git开头的地址啊。
而只能正常处理https的git地址。
转载请注明:在路上 » 【已解决】在cygwin中使用git去安装Node.js的npm结果出错:ssh: connect to host git port 22: Connection timed out,fatal: The remote end hung up unexpectedly