我正在按照迁移建议将MVC5网站转换为ASP.NET核心网站 - http://docs.asp.net/en/latest/migration/mvc.html并且在尝试安装客户端软件包时遇到困难(Bootstrap和jQuery)使用Bower.
我创建了一个空的ASP.NET 5 Web应用程序然后创建了一个bower.json文件,但是当我保存它时,我在Output窗口中得到以下内容
PATH=.\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\git
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\Bower.cmd" install jquery#2.1.4 --production --force-latest --save
bower jquery#2.1.4 not-cached https://github.com/jquery/jquery-dist.git#2.1.4
bower jquery#2.1.4 resolve https://github.com/jquery/jquery-dist.git#2.1.4
bower jquery#2.1.4 checkout 2.1.4
bower jquery#2.1.4 ECMDERR Failed to execute "git clone https://github.com/jquery/jquery-dist.git -b 2.1.4 --progress . --depth 1", exit code of #-532462766
Run Code Online (Sandbox Code Playgroud)
我也尝试在VS中使用Bower Package Manager,结果相同
我正在使用Visual Studio 2015 Update 2和ASP.NET Web Tools RC1-update 1
我看到其他帖子,当这不起作用(有不同的错误),但那些是在公司防火墙/代理后面,我不是
我是这个npm/bower的新手.我错过了什么?
更新:我在命令提示符下运行命令,它仍然无法正常工作,但我确实有更多有关基础错误的详细信息
Unhandled Exception: System.MissingMethodException: Method not found: 'LibGit2Sharp.Branch LibGit2Sharp.RepositoryExtensions.Checkout(LibGit2Sharp.IRepository, LibGit2Sharp.Branch, LibGit2Sharp.Signature)'.
at Microsoft.VisualStudio.GitCli.GitShim.clone(String url, String workingDirectory, String branchName)
at Microsoft.VisualStudio.GitCli.Program.Main(String[] args)
Run Code Online (Sandbox Code Playgroud)
并找到了这个链接,其他人似乎有同样的问题https://connect.microsoft.com/VisualStudio/feedback/details/1322649/bower-cannot-get-packages-with-protocol-git-since-behind -a防火墙
所以看起来是MS发布了这个组件的错误版本的问题
Cht*_*lek 10
不知道为什么会这样,但这就是我解决它的方式:
打开 bash并执行以在git上使用https(防火墙可能阻止git协议):
git config --global url.https://github.com/.insteadOf git://github.com/
配置 Visual Studio以使用这个新的git工具:
只需添加最后一行并取消选中旧的git命令行.
希望这可以帮助
| 归档时间: |
|
| 查看次数: |
3365 次 |
| 最近记录: |