执行 npm install 时出现“隧道套接字"错误 [英] Error 'tunneling socket' while executing npm install

查看:65
本文介绍了执行 npm install 时出现“隧道套接字"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试执行npm install"命令时收到如下所示的错误.

I'm getting the error shown below while trying to execute 'npm install' command.

错误:无法建立隧道套接字,cause=connect ECONNREFUSED 10.232.207.137:8080

Error: tunneling socket could not be established, cause=connect ECONNREFUSED 10.232.207.137:8080

我想念什么?

推荐答案

如果您使用代理,请在 npm 中正确设置.

If you are behind a proxy, set it correctly in npm.

>npm config set proxy http://proxyhost:proxyport
>npm config set https-proxy http://proxyhost:proxyport

注意事项:

  1. 对于 SSL/https 代理,URL 中的协议应该是 http 而不是 https

如果您的设置是在 Docker/Vagrant 实例或托管 VM 上,请使用 IP 地址而不是主机名作为代理,因为后者可能无法解析.

If your set up is on a Docker/Vagrant instance or a hosted VM, use IP address instead of hostname for proxy as the later might not be resolvable.

如果没有代理,从 npm 中删除代理配置

If there is no proxy , remove proxy config from npm

>npm config set proxy null
>npm config set https-proxy null

这篇关于执行 npm install 时出现“隧道套接字"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆