How to fix bower ECMDERR

只愿长相守 提交于 2019-11-26 12:49:17

问题


I\'m using \"yeoman\" and \"bower\" on windows 7 but got the following error when I create the app

yo webapp

The error is

bower not-cached    git://github.com/jlong/sass-bootstrap.git#~3.0.0
bower resolve       git://github.com/jlong/sass-bootstrap.git#~3.0.0
bower not-cached    git://github.com/Modernizr/Modernizr.git#~2.6.2
bower resolve       git://github.com/Modernizr/Modernizr.git#~2.6.2
bower not-cached    git://github.com/jquery/jquery.git#~1.10.2
bower resolve       git://github.com/jquery/jquery.git#~1.10.2
bower ECMDERR       Failed to execute \"git ls-remote --tags --heads git://github
.com/jquery/jquery.git\", exit code of #128

Additional error details:
fatal: unable to connect to github.com:
github.com[0: 192.30.252.130]: errno=No error

The version of the yeoman, bower and node

c:\\yo-test>bower -v
1.2.8

c:\\yo-test>yo -version
1.1.2

c:\\yo-test>node -v
v0.10.15

Any suggestion is much appreciated.


回答1:


In case you might encounter the same issue...It turns out my machine behind firewall, that won't able to access git://github.com/jquery/jquery.git

Link: Unable to Connect to GitHub.com For Cloning

The solution without changing the firewall:

git config --global url."https://".insteadOf git://

Credit to @bnguyen82 from Unable to Connect to GitHub.com For Cloning and @Sindre Sorhus from Bower install using only https?




回答2:


I had the same problem and the answer above didn't work for me. But I found an other one. You can have a problem with your proxy. If you are behind a proxy you have to do theses steps :

put this in .bowerrc to get rid of the err ETIMEDOUT :

{
    "directory": "app/bower_components",
    "proxy": "http://PROXYSERVER:PORT",
    "https-proxy": "https://PROXYSERVER:PORT",
    "strict-ssl": false
}

And this one to get rid of ECMDERR :

git config --global http.proxy http://USER:PASSWORD@PROXYSERVER:PORT

it works for me.

P.S : sorry for my english mistakes I'm french^^




回答3:


Following commands work for me

npm cache clean

bower cache clean

and then

bower install




回答4:


For me updating git to the newest version helped.




回答5:


My bower.json first looked like this:

{
  "name": "HelloIonic",
  "private": "true",
  "devDependencies": {
    "ionic": "driftyco/ionic-bower#1.3.1",
    "ion-datetime-picker": "katemihalikova/ionic-datetime-picker#0.4.0",    
    "ion-tree-list": "fer/ion-tree-list#0.0.10"                             
  }
}

and I had the "failed to execute git remote -ls" problem. After I changed it to the following it suddenly started working:

{
  "name": "HelloIonic",
  "private": true,
  "devDependencies": {
    "ionic": "^1.3.2",
    "ion-datetime-picker": "^0.4.0",
    "ion-tree-list": "^0.0.10"
  },
  "resolutions": {
    "ionic": "^1.0.0-beta.9"
  }
}



回答6:


To contribute to leoh's answer (since I don't have enough rep to post a comment):

If, like me, you found that you could not execute the command because git wasn't installed globally on your machine, opening Tools > Options in Visual Studio, then Projects and Solutions > Web Package Management > External Web Tools, you will see that, by default, there are two git locations:

  • $(DevEnvDir)\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd
  • $(DevEnvDir)\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin

By default (for Visual Studio 2017 Enterprise), these respectively map to:

  • C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd
  • C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin

Then open a command prompt (Windows + R > "cmd"), navigate to the above locations, and run leoh's command. I wasn't sure which to run it from, so I ran it from both just in case. The issue was resolved for me from then on.




回答7:


You can remove all generators which have and install again. It's will be help.




回答8:


In my case it was the antivirus' firewall preventing bower to connect with github. I hadn't realized the antivirus was asking through a windows whether i wanted to allow git to perform connection or not.

I allowed it and it worked like a charm :)




回答9:


solution provided by Dakkon_jareth works for me, I was not having app/bower_components but library there, I changed that to app/bower_components and started working, I will also recommend to try 2-3 times after NPM Cache clean.




回答10:


I had same problem. After installed "Microsoft .NET Core 1.0.0 RC2 - VS 2015" this fix it.




回答11:


I work with VS 2015 and have the NoGit package installed. Updated it to the 0.1.0 and it fixed the problem.

Hope this might help someone.




回答12:


I've also experienced some strange behavior with bower failing to install all dependencies.

None of posted solutions worked for me, that's why I'm posting this answer.

In my case bower install errored randomly almost each time with different package. All packages were on github, so why suddenly ?

unable to resolve github.com

Obviously something was wrong with networking.

Errors were on dockerized Ubuntu 16.04 running in virtualized rancher, so a number of possible points of failure were pretty big.

But fortunately the solution was extremely simple.

I realized that this is a basic installation and does not even have basic networking tools.

So after running apt install net-tools iputils-ping all errors disappeared forever.

Pretty unexpected for me, hope it helps ...




回答13:


Guys install of strugling with this, just manually download it and then do a bower install from local folder instead.



来源:https://stackoverflow.com/questions/21789683/how-to-fix-bower-ecmderr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!