yeoman - 关于git ls-remote时出错

浏览:64日期:2023-10-29

问题描述

请看操作命令:

C:Usersmacrotea>ping www.github.com正在 Ping github.com [192.30.252.128] 具有 32 字节的数据:来自 192.30.252.128 的回复: 字节=32 时间=260ms TTL=44来自 192.30.252.128 的回复: 字节=32 时间=268ms TTL=44来自 192.30.252.128 的回复: 字节=32 时间=257ms TTL=44来自 192.30.252.128 的回复: 字节=32 时间=258ms TTL=44192.30.252.128 的 Ping 统计信息: 数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),往返行程的估计时间(以毫秒为单位): 最短 = 257ms,最长 = 268ms,平均 = 260msC:Usersmacrotea>type c:Usersmacrotea.gitconfig[user] name = macrotea email = macrotea@qq.com[alias] ci = commit co = checkout st = status br = branch throw = reset --hard HEAD throwh = reset --hard HEAD^C:Usersmacrotea>git --versiongit version 1.8.5.2.msysgit.0C:Usersmacrotea>git ls-remote --tags --heads git://github.com/twbs/bootstrap.gitfatal: unable to connect to github.com:github.com[0: 192.30.252.128]: errno=No errorC:Usersmacrotea>ping 192.30.252.128正在 Ping 192.30.252.128 具有 32 字节的数据:来自 192.30.252.128 的回复: 字节=32 时间=360ms TTL=44来自 192.30.252.128 的回复: 字节=32 时间=360ms TTL=44来自 192.30.252.128 的回复: 字节=32 时间=360ms TTL=44来自 192.30.252.128 的回复: 字节=32 时间=354ms TTL=44192.30.252.128 的 Ping 统计信息: 数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),往返行程的估计时间(以毫秒为单位): 最短 = 354ms,最长 = 360ms,平均 = 358msC:Usersmacrotea> why ? help ! thanks!

此问题来源于当使用Yeoman进行yo webapp时出错:

npm http 304 https://registry.npmjs.org/grunt-autoprefixernpm http 304 https://registry.npmjs.org/grunt-svgminbower bootstrap#~3.0.3 ECMDERR Failed to execute 'git ls-remote --tags --heads git://github.com/twbs/bootstrap.git', exit code of #128Additional error details:fatal: unable to connect to github.com:github.com[0: 192.30.252.129]: errno=No errorevents.js:74throw TypeError(’Uncaught, unspecified 'error' event.’); ^TypeError: Uncaught, unspecified 'error' event. at TypeError (<anonymous>) at Appgenerator.EventEmitter.emit (events.js:74:15) at done (C:UsersmacroteaAppDataRoamingnpmnode_modulesgenerator-webappnode_modulesyeoman-generatorlibbase.js:318:16) at C:UsersmacroteaAppDataRoamingnpmnode_modulesgenerator-webappnode_modulesyeoman-generatornode_modulesasynclibasync.js:232:13 at C:UsersmacroteaAppDataRoamingnpmnode_modulesgenerator-webappnode_modulesyeoman-generatornode_modulesasynclibasync.js:113:21 at C:UsersmacroteaAppDataRoamingnpmnode_modulesgenerator-webappnode_modulesyeoman-generatornode_modulesasynclibasync.js:24:16 at C:UsersmacroteaAppDataRoamingnpmnode_modulesgenerator-webappnode_modulesyeoman-generatornode_modulesasynclibasync.js:229:17 at C:UsersmacroteaAppDataRoamingnpmnode_modulesgenerator-webappnode_modulesyeoman-generatornode_modulesasynclibasync.js:516:34 at Appgenerator.<anonymous> (C:UsersmacroteaAppDataRoamingnpmnode_modulesgenerator-webappnode_modulesyeoman-generatorlibactionsinstall.js:43:7) at ChildProcess.EventEmitter.emit (events.js:117:20)

望君多指点!

问题解答

回答1:

应该是你的Github SSH配置问题

可以通过

$ ssh -vT git@github.com

来判断是否配置成功 如果显示

Hello xxxx! You ve successfully authenticated, but GitHub does not provide shell access.

表示成功

具体如何配置SSH 请看https://help.github.com/articles/generating-ssh-keys

回答2:

应该是ssh网关的问题,github的ssh请求有时候会被封掉,不知道为什么用https替换ssh就可以了

这篇文章推荐你/blog/leewind/1190000000691712

相关文章: