NPM 无法安装 Gulp - ECONNRESET 错误

NPM can't install Gulp - ECONNRESET error

我一直在尝试安装 Gulp 几个月,从字面上看。自 8 月或更早以来。每次有效时间,它都会卡住一分钟,然后抛出 ECONNRESET 错误。

npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. 
Use 'npm ls graceful-fs' to find it in the tree.
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network request to http://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz failed, reason: read ECONNRESET
npm ERR! network This is a problem 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! A complete log of this run can be found in:
npm ERR!     C:\Users\Chilli\AppData\Roaming\npm-cache\_logs17-11-22T17_48_46_679Z-debug.log

我没有代理,我已经搜索 google 几个月了,但没有任何效果。我多次更新了 nodejs 和 npm,清除了缓存或代理设置,更改了 http 版本的存储库......日志说它无法安装 glob-stream 包,我也无法手动安装它 - 同样的错误......

NPM 日志:https://pastebin.com/Ci0AYYzY

基本上,您不会全局安装 gulp 软件包,而是 gulp-cli。你的日志说,你试图安装 gulp 包,你想安装它作为 dev dependency(-D argument).

试试这个:

npm install gulp-cli -g
cd your/project/dir
npm install gulp -D