2016-01-22 33 views
5

Tôi có Ứng dụng Cordova được phát triển bằng Visual Studio 2015 IDE. Để quản lý thư viện và phụ thuộc, tôi đã thử sử dụng NuGet. Nhưng có vẻ như, NuGet không thể quản lý các kịch bản lệnh phía máy khách, tức là CSS. Vì vậy, tôi đã khám phá BOWER. Tôi đã cài đặt bower bằng lệnh npm installl -g bower và bây giờ tôi có thể truy cập tất cả các lệnh Bower.Không thể cài đặt Gói Bower

Khi tôi cố gắng thêm các phụ thuộc như jQuery và jQuery Mobile, Thử tìm nạp và không thành công. Các lỗi nó mang lại là,

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       retry Request to https://bower.herokuapp.com/packages/jquery-mobile failed with ECONNRESET, retrying in 1.5s 
bower       retry Request to https://bower.herokuapp.com/packages/jQuery failed with ECONNRESET, retrying in 1.4s 
bower       retry Request to https://bower.herokuapp.com/packages/jQuery failed with ECONNRESET, retrying in 3.0s 
bower       retry Request to https://bower.herokuapp.com/packages/jquery-mobile failed with ECONNRESET, retrying in 3.1s 
bower       retry Request to https://bower.herokuapp.com/packages/jQuery failed with ECONNRESET, retrying in 4.8s 
bower       retry Request to https://bower.herokuapp.com/packages/jquery-mobile failed with ECONNRESET, retrying in 7.0s 
bower       retry Request to https://bower.herokuapp.com/packages/jQuery failed with ECONNRESET, retrying in 9.7s 
bower       retry Request to https://bower.herokuapp.com/packages/jquery-mobile failed with ECONNRESET, retrying in 8.5s 
bower       retry Request to https://bower.herokuapp.com/packages/jQuery failed with ECONNRESET, retrying in 26.5s 
bower       retry Request to https://bower.herokuapp.com/packages/jquery-mobile failed with ECONNRESET, retrying in 25.6s 
bower jQuery#*    ECONNRESET Request to https://bower.herokuapp.com/packages/jQuery failed: tunneling socket could not be established, cause=connect ETIMEDOUT 
====Executing command 'npm install'==== 


npm WARN package.json [email protected] No description 
npm WARN package.json [email protected] No repository field. 
npm WARN package.json [email protected] No README data 

====npm command completed with exit code 0==== 

tôi duyệt và người ta nói rằng tôi phải thiết lập proxy như,

http_proxy = http://<user>:<password>@<your company proxy>:<port> 
https_proxy= http://<user>:<password>@<your company proxy>:<port> 

hoặc tạo một file có tên .bowerrc và đặt mã để vượt qua proxy.

{ 
    "directory": "library", 
    "registry": "http://bower.herokuapp.com", 
    "proxy":"http://<USERNAME>:<PASSWORD>@<PROXY_IP>:<PROXY_PORT>/", 
    "https-proxy":"http://<USERNAME>:<PASSWORD>@<PROXY_IP>:<PROXY_PORT>/" 
} 

Nhưng không có gì hiệu quả. Bây giờ tôi đã thử với mạng mở với Không có proxy, tôi nhận được lỗi tương tự. Tôi có thiếu bất kỳ bước cơ bản nào không?

Tôi cũng đã thử từ cửa sổ nhắc lệnh. Có lỗi tương tự.

+0

bạn có thể truy cập https://bower.herokuapp.com/packages bằng trình duyệt không? – Shuping

+0

Có, tôi có thể truy cập tương tự từ trình duyệt. URL ** https: //bower.herokuapp.com/packages/jQuery** đã cho tôi câu trả lời '{" name ":" jQuery "," url ":" git: //github.com/jquery/jquery. git "," hits ": 47370}' – Joseph

+0

Đã thử cài đặt lại NodeJ, Cordova và Bower. Nhưng không thể làm đúng. Bất cứ ai có thể chia sẻ ý tưởng của họ giúp tôi giải quyết vấn đề. Thử nghiệm nhiều chủ đề và blog nhưng không may mắn – Joseph

Trả lời

1

Các bạn đã cố gắng để thay đổi giao thức git từ https git bằng cách thực hiện:

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

Cám ơn sự ủng hộ của bạn. Tôi thực sự đã tìm ra lý do. Mặc dù, tôi không thuộc proxy công ty của tôi, đã có thiết lập một tài sản trong các biến môi trường. Điều đó ngụ ý proxy mặc dù tôi đang ở trong một mạng lưới mở. Không biết phần mềm nào đã thực hiện mục nhập trong các biến môi trường. Tôi đã xóa nó và nó hoạt động ngay bây giờ.

+0

Cách gọi biến này? Bạn vừa xóa nó? hoặc người khác .. Bởi vì tôi có cùng một vấn đề. –

Các vấn đề liên quan