Node.js npm安装模块错误:隧道套接字错误

Node.js npm安装模块错误:隧道套接字错误,node.js,npm,proxy,Node.js,Npm,Proxy,我无法在windows上使用npm安装nodejs模块。我在一个代理后面,我设置代理如下: npm config set proxy internet.cp:8080 npm config set proxy-http internet.cp:8080 当我尝试安装数据包时,出现以下错误: npm info retry will retry, error on last attempt: Error: tunneling socket could not be established 我有一

我无法在windows上使用npm安装nodejs模块。我在一个代理后面,我设置代理如下:

npm config set proxy internet.cp:8080
npm config set proxy-http internet.cp:8080
当我尝试安装数据包时,出现以下错误:

npm info retry will retry, error on last attempt: Error: tunneling socket could not be established
我有一些问题:

 - how can I make npm work with socks5
 - can I configure a proxycap file so that npm will use socks5
 - other suggestions

这可能是因为您的代理阻止了https请求

在安装数据包之前,请尝试执行以下命令

npm config set registry http://registry.npmjs.org/

希望这有帮助

结果是我使用的代理不是正确的。使用正确的代理并使用上面的命令进行设置后,它就工作了

npm config set proxy internet.cp:8080
npm config set proxy-http internet.cp:8080

它不起作用。npm info retry将重试,上次尝试时出错:错误:自签名证书链。在执行上述回答中提到的
npm config…
命令之前,请尝试执行
npm config set ca=null
。它仍然不起作用,我有相同的错误(自签名ca)