删除代理

1
2
npm config delete proxy
npm config delete https-proxy

设置所有代理

1
npm config set proxy=http://127.0.0.1:8087

设置 Https 代理

1
npm config set https-proxy http://server:port

Yarn 设置代理还需要

1
yarn config set strict-ssl false

带密码的代理

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