Npm install reported an error socket hang up ..

  node.js, question

Npm is installing and running module.npm install webpack-dev-server --save-devWhen reporting an error

The error is reported as follows:

npm ERR! fetch failed http://registry.npmjs.org/express/-/express-4.13.4.tgz
npm WARN retry will retry, error on last attempt: Error: socket hang up

Cnpm installation still reports this error.

npm ERR! fetch failed https://registry.npm.taobao.org/webpack-dev-server/download/webpack-dev-server-1.14.1.tgz
npm WARN retry will retry, error on last attempt: Error: socket hang up

The agent only used shadowsocks, turned on the global agent and turned it off, and still reported these errors.

Implementednpm config set registry http://registry.npmjs.org/Still reporting errors.

Implementednpm config get https-proxy npm config get proxyAll returned null.

After reinstalling npm and upgrading npm, the error is still reported.

The content under ~/.npmrc is onlyregistry=http://registry.npmjs.org/

Google,Baidu Baidu haven’t solved it for a long time. We have to ask for advice and see what is going on .. Thank you

As shown in the figure of npm config list: since npm was reloaded with macport, the version number is 2.x. remember to use 3.X before reloading? ?
This is the upgraded npm, and the initial installation is shown in Figure 2.14.3 below. Errors are still reported before and after upgrading.
图片描述

In addition, the sudo execution effect is also reported as an error, as shown in the figure:
图片描述

But in addition, the browser directly accesses it.http://registry.npmjs.org/express/-/express-4.13.4.tgzYou can download files.

If you aremac osxLiving isLinuxAdd before the systemsudoGive it a try.

sudo npm install webpack-dev-server --save-dev