NPM不安装任何模块:networking套接字挂起

萨拉姆(手段你好):)

我在Ubuntu 12.04上安装了最新版本的node.js,我没有落后于任何代理,而且我的networking设置已经正确configuration,并且自上次NPM正常工作以来保持完好无损。 但是现在NPM挂起安装任何模块,出现以下错误:

nasser@nasser-desktop:~/projects/server v3$ npm install simple-proxy npm WARN package.json docco@0.6.2 No repository field. npm http GET https://registry.npmjs.org/simple-proxy npm http GET https://registry.npmjs.org/simple-proxy npm http GET https://registry.npmjs.org/simple-proxy npm ERR! network socket hang up 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 Linux 3.5.0-17-generic npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "simple-proxy" npm ERR! cwd /home/nasser/projects/serverV3 npm ERR! node -v v0.10.18 npm ERR! npm -v 1.3.8 npm ERR! code ECONNRESET npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/nasser/projects/serverV3/npm-debug.log npm ERR! not ok code 0 

我有同样的问题。 看来ISP的https处理存在一些问题。 这样做的:

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

为我工作

我遇到了同样的问题。 在这个线程中find了解决scheme。 你可以看到npm正在使用的有效代理:

 npm config get proxy npm config get https-proxy 

如果你是一个代理人,试试这个:

 mv ~/.npmrc ~/.npmrc.bak 

我有一个类似的问题,我的Windows机器,我通过执行下面的命令首先检查我的代理是否得到一些价值。

 npm config get proxy 

作为回报,我得到了以下:

 http://usr:pwd@host/:port 

因此,如果任何不在代理层下的人先执行下面的命令,将代理设置为null。

 npm config set proxy null 

现在如果你超越你的npm我不应该抛出任何networking错误。

如果您位于具有用户名和密码身份validation的代理之后,请尝试将代理设置为

npmconfiguration设置代理http://用户名:encodedpassword @ proxyaddress:端口

npm config set https-proxy http:// username:encodedpassword @ proxyaddress:port

find.npmrc文件,用记事本打开。 然后在那里删除代理设置