无法安装Bower软件包

时间:2016-01-22 09:38:57

标签: node.js proxy bower http-proxy bower-install

我有一个使用Visual Studio 2015 IDE开发的Cordova应用程序。为了管理库和依赖项,我尝试使用NuGet。但看起来,NuGet无法管理客户端脚本,即CSS。所以我探索了BOWER。我使用命令npm installl -g bower安装了bower,现在我可以访问所有Bower命令。

当我尝试添加jQuery和jQuery Mobile等依赖项时,它会尝试抓取并失败。它给出的错误是,

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 WellnessAdvisor@1.0.0 No description
npm WARN package.json WellnessAdvisor@1.0.0 No repository field.
npm WARN package.json WellnessAdvisor@1.0.0 No README data

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

我浏览过,据说我必须设置代理,

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

或创建一个名为.bowerrc的文件,并放置代码以克服代理。

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

但没有任何效果。现在我尝试使用没有代理的开放网络,我收到同样的错误。我错过了任何基本步骤吗?

我也尝试过命令提示符窗口。得到了同样的错误。

2 个答案:

答案 0 :(得分:2)

感谢您的支持。我实际上找到了原因。即使我不在我的公司代理下,也在环境变量中设置了一个属性。这意味着代理甚至 - 虽然我是在一个开放的网络下。不知道哪个软件在环境变量中输入了。我删除了它,它现在有效。

答案 1 :(得分:1)

您是否已尝试通过执行以下命令将git协议从https更改为git:

git config --global url."git://".insteadOf https://
相关问题