npm | npm install 配置代理
npm | npm install 配置代理
命令如下
1 | npm config set proxy http://username:password@host:port |
举例
1 | npm config set proxy http://127.0.0.1:8889 |
或者直接编辑 ~/.npmrc 文件
1 | proxy=http://username:password@host:port |
查看 npm 配置信息
1 | npm config list |
实例
1 | PS D:\> npm config list |
扩展
yarn 配置代理
1 | yarn config set proxy http://username:password@host:port |