npm publish出错,‘proxy‘ config is set properly. See: ‘npm help config‘

问题:使用 npm publish发布项目依赖失败,报错 'proxy' config is set properly. See: 'npm help config'

1、先查找一下自己的代理

javascript 复制代码
npm config get proxy
npm config get https-proxy
npm config get registry
2、然后将代理和缓存置空

方式一:

javascript 复制代码
npm config set proxy false
npm cache clean --force

方式二:

javascript 复制代码
npm config set proxy null
npm config set https-proxy null
3、配置新的镜像源,选一个就行
javascript 复制代码
# 淘宝源(推荐)
npm config set registry http://registry.npm.taobao.org/

# 官方源
npm config set registry http://registry.npmjs.org/
npm config set registry https://registry.npmjs.org/

# cnpm 源
npm config set registry https://registry.cnpmjs.org/
# 如果使用 cnpm,注意是否安装了 cnpm,cnpm 走推荐走的也是淘宝源
npm install -g cnpm --registry=https://registry.npm.taobao.org/
相关推荐
程序员古德20 分钟前
《论负载均衡技术在Web系统中的应用》写作框架,软考高级系统架构设计师
前端·系统架构·负载均衡
小白小白从不日白1 小时前
TS axios封装
前端·typescript
某公司摸鱼前端2 小时前
浏览器页面被禁用 F12(dev tools)
前端
快乐小土豆~~3 小时前
el-input设置后缀显示单位并阻止滚轮微调
前端·vue.js·elementui
下雪天的夏风3 小时前
解决:Vue 中 debugger 不生效
前端·javascript·vue.js
AC它真的很香3 小时前
el-table使用合计和固定列时,滚动条被覆盖区域无法拖拽问题
前端·javascript·vue.js
diygwcom3 小时前
electron多标签页模式更像客户端
前端·javascript·electron
加勒比海涛3 小时前
Element UI:初步探索 Vue.js 的高效 UI 框架
前端·vue.js·ui
柴华松3 小时前
多张GPU卡
java·服务器·前端
fruge3 小时前
【UI】element ui table(表格)expand实现点击一行展开功能
前端·vue.js·ui