背景
我创建了空的ASP .NET MVC项目,打开了 Manage Bower Packages 窗口并尝试安装foo包。 我收到以下错误:
PATH=.\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Web\External;%PATH%;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
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Web\External\Bower.cmd" install foo#v4.0.0 --force-latest --save
bower foo#v4.0.0 not-cached https://github.com/bar/foo.git#v4.0.0
bower foo#v4.0.0 resolve https://github.com/bar/foo.git#v4.0.0
bower foo#v4.0.0 ECMDERR Failed to execute "git ls-remote --tags --heads https://github.com/bar/foo.git", exit code of #128
问题
如何修复上述错误?
注意
这个问题严格地与Visual Studio有关。在这种情况下,运行以下命令无法修复问题。
git config --global url."https://".insteadOf git://