杂项警告 设置 vue 应用程序时重置 ECONNSET



我正在尝试通过vue-cli设置vue应用程序。一切都很顺利,直到我打字

npm install 

以安装依赖项。这是https的错误,所以我将其更改为http但后来我得到这个日志:

npm WARN registry Unexpected warning for http://registry.npmjs.org/: Miscellaneous Warning ECONNRESET: request to http://registry.npmjs.org/debug failed, reason: socket hang up
npm WARN registry Using stale package data from http://registry.npmjs.org/ due to a request error during revalidation.

我也用了

npm config rm proxy
npm config rm https-proxy

并且仍然有同样的问题。

手动将 https 更改为 http

npm config set registry="http://registry.npmjs.org/"
npm config set strict-ssl false

如果您在代理后面,请忽略此内容

npm config set proxy http://username:password@10.80.81.180:80
npm config set https-proxy http://username:password@10.80.81.180:80

安装 vue-cli

npm install -g vue-cli

设置 vuejs 项目

vue-init webpack-simple vueproject

安装依赖项

npm install

现在你的 vuejs 样板项目设置已经完成

更新 #1

首先清除 npm 缓存,然后尝试上述步骤

npm cache clear --force

最新更新