最新消息:VPS服务器又从fzhost.net换回Linode了,主题仍用朋友推荐的大前端D8

【已解决】在cygwin中使用git去安装Node.js的npm结果出错:ssh: connect to host git port 22: Connection timed out,fatal: The remote end hung up unexpectedly

Node.js crifan 207浏览 0评论

【问题】

参考:

http://www.infoq.com/cn/articles/nodejs-npm-install-config?utm_source=infoq&utm_medium=related_content_link&utm_campaign=relatedContent_articles_clk

去在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

跳转到:

https://github.com/isaacs/npm

网站上看到了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

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
15 queries in 0.181 seconds, using 9.90MB memory