node.js - 设置vue app时出现杂项警告ECONNRESET

标签 node.js npm vue.js

我正在尝试通过 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

关于node.js - 设置vue app时出现杂项警告ECONNRESET,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48255264/

相关文章:

node.js - 为什么协会在 Sequelize 中不起作用?

reactjs - 'Invariant Violation : requireNativeComponent: "RNSScreen" was not found in the UIManager.' react native cli 错误

css - Vue Material Drawer(如何在 md-content 中显示 file.vue)

vue.js - 无法在Vuejs中访问ag-Grid API

node.js - 如何修复使用 AWS SES 和 Lambda 发送电子邮件的问题?

javascript - Mongoose 模式

node.js - 依赖版本的空字符串 ("") 在 npm 包中意味着什么?

php - 在 laravel 应用程序中安装 npm 包

javascript - Vue如何将for循环按钮表分成表中的不同行

javascript - 如何从html中的javascript获取参数