首页 > Web开发 > 详细

vue install 报错 This is a problem related to network connectivity.

时间:2020-03-26 16:43:06      阅读:1900      评论:0      收藏:0      [点我收藏+]

在终端安装任何包,执行 npm i均报错

npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org
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 代理出错

可尝试依次执行:

npm config get proxy

npm config get https-proxy

两者均返回null,否则,执行set null的命令,再安装淘宝镜像

npm config set registry http://registry.cnpmjs.org/

npm install -g cnpm --registry=https://registry.npm.taobao.org

之后可以执行npm i

了解不多,原理方面不太清楚,欢迎多多指教

vue install 报错 This is a problem related to network connectivity.

原文:https://www.cnblogs.com/jingjing-blogs/p/12574471.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!