npm设置和取消代理的方法

设置代理

npm config set proxy=http://server:port
npm config set https-proxy https://server:port // https代理设置
npm config set registry=http://registry.npmjs.org

需要认证的话,设置代理用户名和密码

npm config set proxy http://username:password@server:port
npm confit set https-proxy http://username:password@server:port

取消代理

npm config delete proxy
npm config delete https-proxy

 

posted @ 2021-08-05 10:32  键盘敲飞  阅读(189)  评论(0编辑  收藏  举报