npm设置代理
# npm config set proxy http://192.168.16.28:8118
# npm config set https-proxy http://192.168.16.28:8118
# npm config set registry=https://registry.npm.taobao.org
# npm config ls
# npm install -g yarn
代理用户名和密码
npm config set proxy http://username:password@server:port
npm confit set https-proxy http://username:password@server:port
或者编辑用户目录下的~/.npmrc file
proxy=http://username:password@host:port
https-proxy=http://username:password@host:port
npm取消代理
npm config delete proxy
npm config delete https-proxy
yarn代理配置
yarn config set proxy http://username:password@host:port
yarn config set https-proxy http://username:password@host:port