【问题标题】:npm install -> tunneling socket could not be establishednpm install -> 无法建立隧道套接字
【发布时间】:2014-11-21 03:06:31
【问题描述】:

这个错误信息已经在 Stack Overflow 上回答了好几次了,但是所有的解决方案都对我不起作用。

每当我npm install 时,我都会收到以下消息:

npm ERR! network tunneling socket could not be established, statusCode=407
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Repos\[repo-name]
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ECONNRESET

它之前工作过很多次,但突然停止工作。我记得唯一改变的是我安装了 VMWare Player。但我不明白为什么这是相关的。

有时,邮件中会显示cause=Parse Error,而不是statusCode=407

我尝试了以下方法:

  • 使用npm config set proxynpm config set https-proxy 设置代理
  • 将注册表更改为http://registry.npmjs.org
  • strict-ssl 设置为false
  • 使用npm cache clean 清除 npm 的缓存

我没有选择

【问题讨论】:

    标签: node.js proxy npm tunneling


    【解决方案1】:

    找到了我自己的解决方案。

    我几天前更改了我的域密码,我需要更新cntlm ini文件

    【讨论】:

      【解决方案2】:

      如果您使用代理,则必须:

      npm config set proxy https://username:password@proxy:port
      
      npm config set https-proxy https://username:password@proxy:port
      

      如果您不使用用户名和密码,请避免在命令行中使用“username:password@”。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-12-10
        • 1970-01-01
        • 2016-01-14
        • 2016-04-19
        • 2015-09-27
        • 1970-01-01
        相关资源
        最近更新 更多