我正在尝试通过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
仍然有同样的问题。
答案 0 :(得分:1)
手动将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