Cấp bậc tác giả:

DOTNET

Lỗi Visual Studio 2015 bower không thể tự động cài đặt được

Được viết bởi webmaster ngày 05/08/2016 lúc 10:53 PM
Sử dụng Empty Template trong Visual Studio 2015, thiết lập sai việc cài đặt dependencies.
  • 0
  • 5592

Lỗi Visual Studio 2015 bower không thể tự động cài đặt được

Ví dụ một phần trong bower
{
  "name": "ASP.NET",
  "private": true,
  "dependencies": {
    "bootstrap": "3.0.0",
    "bootstrap-touch-carousel": "0.8.0",
    "hammer.js": "2.0.4",
    "jquery": "2.1.4",
    "jquery-validation": "1.11.1",
    "jquery-validation-unobtrusive": "3.2.2"
  }
}

Nó báo cài đặt không thành công với dòng sau:

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\Bower.cmd" install --force-latest
bower bootstrap#3.0.0        ENOTFOUND Request to https://bower.herokuapp.com/packages/bootstrap failed: getaddrinfo ENOTFOUND

Như vậy là nó không thể thực thi được file này: "git ls-remote --tags --heads https://github.com/twbs/bootstrap.git"

Để fix lỗi này, thực hiện các thao tác sau:

1. Cài đặt công cụ git (nếu chưa cài đặt) từ http://git-scm.com/download/win
2. Trong dòng dấu nhắc lệnh nhấn enter: git config --global url."http://".insteadOf git://
3. Trong menu Tools VS  > Options.. > Projects and Solutions > External Web Tools
4. Bỏ chọn $(DevEnvDir)\Extensions\Microsoft\Web Tools\External\git
5. Thêm vào C:\Program Files (x86)\Git\bin

Nguồn bài viết: DOTNET.VN

BÌNH LUẬN BÀI VIẾT

Bài viết mới nhất

LIKE BOX

Bài viết được xem nhiều nhất

HỌC HTML