【问题标题】:npm behind not working behind cntml proxynpm 在cntml 代理后面不工作
【发布时间】:2016-12-15 15:20:41
【问题描述】:

由于代理身份验证问题,我使用cntml 通过cntml 代理重定向我们的代理。 npm 安装非常慢(快速启动项目需要数小时)

我用这个设置了 npm 代理:

npm config set proxy http://localhost:1111
npm config set https-proxy http://localhost:1111
npm config set registry http://registry.npmjs.org

CNTML 适用于非常快的情况,例如铬。 什么会导致 npm 失败?

【问题讨论】:

    标签: angularjs node.js proxy npm reverse-proxy


    【解决方案1】:

    如果您在公司代理后面工作,仅提供主机:端口可能还不够。我已经通过以下步骤获得了成功:

    npm config set strict-ssl false
    
    npm config set registry "http://registry.npmjs.org/"
    

    下面,%5C 是反斜杠的替换,很重要

    npm config set proxy http://<domain>%5C<username>:   
    <password>@<host>:<port>
    
    npm config set https-proxy http://<domain>%5C<username>:
    <password>@<host>:port
    
    npm install <npm_package>
    

    以下是代理使用示例:

    npm config set proxy http://MyDomain%5CMyUsername:
    MyPassword@myproxy.mycorp.net:1234
    

    【讨论】:

      猜你喜欢
      • 2018-01-09
      • 2017-07-19
      • 1970-01-01
      • 1970-01-01
      • 2011-11-25
      • 1970-01-01
      相关资源
      最近更新 更多