代码之家  ›  专栏  ›  技术社区  ›  Sphinx

npm安装在一个代理之后,但得到Http错误=407(Forefront TMG需要授权)

  •  0
  • Sphinx  · 技术社区  · 6 年前

    我的笔记本使用MacOS,并且已经在 网络首选项 ,但在运行时始终无法安装任何程序包 npm install 407 Proxy Authentication Required .

    cntlm公司

    下面是测试 通过 (返回HTTP代码200):

    cntlm -c /usr/local/etc/cntlm.conf -I -M http://registry.npmjs.org/vue
    Password: 
    Config profile  1/4... OK (HTTP code: 200)
    ----------------------------[ Profile  0 ]------
    Auth            NTLMv2
    PassNTLMv2      28B089518C6573274C6B9D83D0XXXXXX
    

    当我跑的时候 npm i vue-cli -g cntlm公司 是否收到以下请求:

    cntlm -c /usr/local/etc/cntlm.conf -f
    Oct 15 15:12:29  cntlm[17646] <Info>: Cntlm ready, staying in the foreground
    Oct 15 15:12:38  cntlm[17646] <Info>: Using proxy company-proxy:80
    Oct 15 15:12:38  cntlm[17646] <Debug>: 127.0.0.1 GET http://registry.npmjs.org/nexe
    

    节点

    npm i vue-cli -g
    npm ERR! code E407
    npm ERR! 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  ): vue-cli@latest
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /Users/****/.npm/_logs/2018-10-15T23_13_47_019Z-debug.log
    

    这让我很困惑:因为考试是通过的,但为什么是考试 仍然无法连接到npmjs.org?

    1 回复  |  直到 6 年前
        1
  •  0
  •   Sphinx    6 年前

    解决方案

    1. 不要使用纯文本密码 # 一开始 Password 线,像变化 Password XXX #Password XXX )

    2. , ,

    默认的cntlm配置文件已经介绍了如何生成它们的步骤。

    我的脚步声 具体如下:

    1. cntlm -H -d your_domain -u your_username

    2. 然后提示密码,填写密码后点击 输入

    Password:
    PassLM          F5314AF8A2DB16BDB7EE9FA6CFC5BC9A
    PassNT          4EC02E0D65F8F0C1A9386C69CB6A2555
    PassNTLMv2      28B089518C6573274C6B9D83D0EB8651 
    
    1. 将以上哈希值粘贴到配置文件中的相关字段。

    2. ,它起作用了。