bower install
在代理后面超时失败,设置如下(有些设置没用...):
git config --global http.proxy fr-proxy.example.com:3128
git config --global https.proxy fr-proxy.example.com:3128
export http_proxy=http://fr-proxy.example.com:3128
export https_proxy=http://fr-proxy.example.com:3128
npm config set proxy http://fr-proxy.example.com:3128
npm config set https-proxy http://fr-proxy.example.com:3128
npm config set registry http://registry.npmjs.org/
我还尝试了安装/卸载 bower 和 bower clean cache
。
最佳答案
编辑您的 .bowerrc 文件并添加所需的代理配置:
{
"proxy":"http://<host>:<port>",
"https-proxy":"http://<host>:<port>"
}
如果在经过身份验证的代理后面工作,用户名和密码应如下所示:
{
"proxy":"http://<user>:<password>@<host>:<port>",
"https-proxy":"http://<user>:<password>@<host>:<port>"
}
通常,.bowerrc 位于 bower.json 旁边。如果bower.json文件附近没有.bowerrc文件,可以自己创建一个。
关于node.js - 代理后面的 bower ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21705091/