获取 Node.js npm 命令以在公司代理后面工作 [英] Get Node.js npm command to work behind corporate proxy
问题描述
我正在尝试安装 bower
I am trying to install bower
npm install -g bower
npm install -g bower
但我从我们的代理处收到身份验证错误
but am getting an authentication error from our proxy
...npm http 407 http://registry.npmjs.org/bower...错误代码:407 需要代理身份验证....
... npm http 407 http://registry.npmjs.org/bower ... Error Code: 407 Proxy Authentication Required. ...
我试图让 npm 在公司代理后面工作.我认为我们的代理有点奇怪,因为我能够获得 maven 下载包的唯一方法是添加 wagon-http-lightweight.jar 作为 maven 扩展.
I am trying to get npm working behind a corprate proxy. I think our proxy is a little weird because the only way I was able to get maven downloading packages was to add wagon-http-lightweight.jar as a maven extension.
http://maven.apache.org/wagon/wagon-providers/wagon-http-lightweight/
我已经尝试了此处描述的所有常规操作:有没有办法让 npm install(命令)在代理后面工作?
I have tried all the regular things as described here: Is there a way to make npm install (the command) to work behind proxy?
(我不需要在我的 Maven 代理设置中提供身份验证详细信息).
(I don't need to supply authentication details in my maven proxy settings).
npm 配置设置注册表 http://registry.npmjs.org/npm 配置集代理 http://myusername:mypassword@proxy.us.somecompany:8080npm 配置集 https-proxy http://myusername:mypassword@proxy.us.somecompany:8080一>npm 配置设置strict-ssl false
npm config set registry http://registry.npmjs.org/ npm config set proxy http://myusername:mypassword@proxy.us.somecompany:8080 npm config set https-proxy http://myusername:mypassword@proxy.us.somecompany:8080 npm config set strict-ssl false
我还能尝试什么?
推荐答案
我能够通过安装本地代理来使其正常工作:
I was able to get this working by installing a local proxy:
这篇关于获取 Node.js npm 命令以在公司代理后面工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!