npm设置代理

工作环境走代理上网,npm不能下载,报错connect ETIMEDOUT

1.设置代理

## http
npm config set proxy=http://server:port
## https
npm config set https-proxy http://server:port

2.代理需要用户名密码

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

3.取消代理

## http
npm config delete proxy
## https
npm config delete https-proxy
原文地址:https://www.cnblogs.com/HeCG95/p/11976354.html