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

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

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

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

方式一:

npm config set proxy false
npm cache clean --force

方式二:

npm config set proxy null
npm config set https-proxy null
3、配置新的镜像源,选一个就行
# 淘宝源(推荐)
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/

4、查看镜像使用状态

npm config get registry