node.js - 代理后面的 bower

标签 node.js proxy npm bower

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/

相关文章:

node.js - GatsbyJS/ReactJS 未正确代理请求

javascript - 在一台机器上安装两个不同版本的 grunt

javascript - 为开发与生产中的 Assets 提供服务

node.js - 通过值或变量设置项目阶段键

javascript - 如何在没有 MongoDb 的情况下使用 Parse 服务器?

javascript - 发布 npm 时,获取 npmpublish npm ERR! 403 禁止 PUT https://registryname/- 禁止

javascript - NPM:字段 'browser' 不包含有效的别名配置

javascript - 如何查询 Node.Js 的后端并更新页面而不重新加载 URL?

http - 读取缓冲区并将其重写为 Go 中的 http.Response

proxy - 将路径附加到主机 HAPROXY