常用CLI工具使用代理

常用CLI工具使用代理

1
2
3
4
5
6
7
# npm
npm config set http=http://localhost://50321
npm config set https-proxy=http://localhost://50321

# yarn
yarn config set http=http://localhost://50321
yarn config set https-proxy=http://localhost://50321

因为,npm 默认的 registry 是 https://registry.npmjs.org,所以第二条设置才是有效的。