簡體   English   中英

Bower VS 2015失敗

[英]Bower is failing with VS 2015

語境:

我正在我的VS 2015 Update 2 ASP.NET 4.6項目中嘗試使用Bower。 Bower 已通過npm在該項目下成功安裝 創建保存的bower.json后,將出現與git相關的錯誤消息。 (請參見展覽)

注意:

這不是協議更改問題(git://-> https://)。 該協議已經是https。

題:

如何配置Bower與VS 2015 ASP Web應用程序一起使用。

涼亭輸出展品:

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 --force-latest
bower jquery-validation-unobtrusive#*       not-cached https://github.com/aspnet/jquery-validation-unobtrusive.git#*
bower jquery-validation-unobtrusive#*          resolve https://github.com/aspnet/jquery-validation-unobtrusive.git#*
bower modernizr#*                           not-cached https://github.com/Modernizr/Modernizr.git#*
bower modernizr#*                              resolve https://github.com/Modernizr/Modernizr.git#*
bower bootstrap#*                           not-cached https://github.com/twbs/bootstrap.git#*
bower bootstrap#*                              resolve https://github.com/twbs/bootstrap.git#*
bower jquery-validation-unobtrusive#*         checkout v3.2.6
bower modernizr#*                             checkout v3.3.1
bower bootstrap#*                             checkout v3.3.6
bower jquery-validation-unobtrusive#*          ECMDERR Failed to execute "git clone https://github.com/aspnet/jquery-validation-unobtrusive.git -b v3.2.6 --progress . --depth 1", exit code of #-532462766

嘗試更新您的git版本( https://git-scm.com/ ),只需下載最新的二進制文件,確保VS已關閉並安裝。

在安裝時通過MinTTY選擇Windows控制台 (未嘗試其他方法)

然后只需啟動VS並還原Bower軟件包

這幫助我解決了與您相同的確切錯誤(在VS 2015 Enterprise + ASP.NET Core RC1上),同時安裝了ASP.NET MVC 6 Boilerplate

確保該目錄中存在一個名為“ .bowerrc”的bower.json文件

其內容應為:

{“目錄”:“ wwwroot / lib”}

這為我解決了! :)

不知道為什么會這樣,但這是我解決的方法:

  • http://git-scm.com/ 安裝獨立的Git
  • 打開 bash並執行以在git上使用https代替(防火牆可能會阻止git協議):

    git config --global url.https://github.com/.insteadOf git://github.com/

  • 配置 Visual Studio以使用此新的git工具代替:

    在此處輸入圖片說明 添加最后一行,然后取消選中舊的git命令行。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM