首页 VueJS npm 下载依赖项显示proxy代理错误network ‘proxy‘ config is set properly. See: ‘npm help config‘

npm 下载依赖项显示proxy代理错误network ‘proxy‘ config is set properly. See: ‘npm help config‘

作者:胡同里的砖头 围观群众:218 更新于:2024-03-06

下载node依赖包总是会出现问题

npm ERR! network request to https://registry.npm.taobao.orge/@vue%2fcli failed, reason: getaddrinfo ENOTFOUND registry.npm.taobao.orge
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犯错!network与网络连通性有关的问题。
npm犯错!网络在大多数情况下,你背后的代理或有坏的网络设置。
npm犯错!网络 npm犯错!网络如果你是一个代理,请确保 npm犯错!网络“代理”配置设置正确。
参见:'npm help config'
原理:后台设置的proxy代理环境有问题,可能会有缓存

解决办法:

可以关闭代理然后清理代理环境在进行下载

设置代理关闭

指令:npm config set proxy false

清除缓存

npm cache clean

注意,如果出现:清除缓存时报错,如下所示:
npm ERR! As of npm@5, the npm cache self-heals from corruption issues 
npm ERR! by treating integrity mismatches as cache misses. As a result,
npm ERR! data extracted from the cache is guaranteed to be valid. If you
npm ERR! want to make sure
则使用强制清除缓存指令

npm cache clean --force

设置淘宝镜像或者别的环境

npm config set registry https://registry.npm.taobao.org

然后再执行命令就可以正常完成了

  • 本文标题: npm 下载依赖项显示proxy代理错误network ‘proxy‘ config is set properly. See: ‘npm help config‘
  • 文章分类:【VueJS】
  • 非特殊说明,本文版权归【胡同里的砖头】个人博客 所有,转载请注明出处.
留言评论
站点声明:
1、本站【胡同里的砖头】个人博客,借鉴网上一些博客模板,取其各优点模块自行拼装开发,本博客开发纯属个人爱好。
2、所有笔记提供给广大用户交流使用,可转载,可复制,纯个人开发所遇问题锦集记录使用
Copyright © huzlblog.com All Rights Reserved. 备案号:苏ICP备2021056683号-8