我正在尝试将Bower用于Web应用程序,但发现自己遇到了某种代理问题:
D:\>bower search jquery
bower retry Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 1.2s
bower retry Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 2.5s
bower retry Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 6.8s
bower retry Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 15.1s
bower retry Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 20.3s
bower ECONNRESET Request to https://bower.herokuapp.com/packages/search/jquery failed: tunneling socket could not be established, cause=Parse Error
Run Code Online (Sandbox Code Playgroud)
相关要点:
有任何想法吗?
Soh*_*ail 162
谢谢@ user3259967
这完成了这项工作.
我想补充一点,如果您在需要进行身份验证的代理后面,可以将用户名/密码添加到.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>/"
}
Run Code Online (Sandbox Code Playgroud)
注意在https-proxy中使用http://
Ade*_*uno 38
我的解决方案就是这个配置.bowerrc
{
"directory": "vendor",
"registry": "http://bower.herokuapp.com",
"proxy": "http://<user>:<pwd>@proxy.host.br:8080",
"https-proxy": "http://<user>:<pwd>@proxy.host.br:8080",
"strict-ssl": false
}
Run Code Online (Sandbox Code Playgroud)
使用https-proxy中的http协议加上带http协议的注册表项.
请记住将8080端口号更改为您的代理服务器端口.
小智 20
你是代理人吗?
您是否设置了环境变量HTTP_PROXY和HTTPS_PROXY?
SET HTTP_PROXY=http://yourproxyserver:yourproxyport
SET HTTPS_PROXY=http://yourproxyserver:yourproxyport
Run Code Online (Sandbox Code Playgroud)
小智 12
尝试更改.bowerrc中的注册表值:
{
"registry": "http://bower.herokuapp.com"
}
Run Code Online (Sandbox Code Playgroud)
小智 9
我没有.bowerrc文件来配置我的凉亭设置.我发现这些设置存在于名为defaults.js的文件中.在"C:\ ...\bower \node_modules\bower-config\lib\util\defaults.js "下找到
我希望这有助于其他人:
var defaults = {
'cwd': process.cwd(),
'directory': 'bower_components',
'registry': 'http://bower.herokuapp.com',
'shorthand-resolver': 'git://github.com/{{owner}}/{{package}}.git',
'tmp': paths.tmp,
'proxy': '<<http://user:pass@proxy:port>>', // change proxy here or at the top
'https-proxy': '<<http://user:pass@proxy:port>>', // change proxy here or at the top
'timeout': 30000,
'ca': { search: [] },
'strict-ssl': false,
'user-agent': userAgent,
'color': true,
'interactive': null,
'storage': {
packages: path.join(paths.cache, 'packages'),
links: path.join(paths.data, 'links'),
completion: path.join(paths.data, 'completion'),
registry: path.join(paths.cache, 'registry'),
empty: path.join(paths.data, 'empty') // Empty dir, used in GIT_TEMPLATE_DIR among others
}
};
module.exports = defaults;Run Code Online (Sandbox Code Playgroud)
您可以尝试在GitHub 上将@thebignet建议同样的问题
设置proxy,https-proxy并strict-ssl配置到 .bowerrc文件:
{
"proxy" : "http://<host>:<port>",
"https-proxy" : "http://<host>:<port>",
"strict-ssl" : false
}
Run Code Online (Sandbox Code Playgroud)
但是你必须从终端运行Command:
git config --global url."https://".insteadOf git://
Run Code Online (Sandbox Code Playgroud)