开发计算机软件命令行常用命令行工具镜像源或代理的配置与使用
笑笑轩npm 镜像
查看当前镜像源
返回 npm 官方源
1
| npm config set registry https://registry.npmjs.org/
|
使用国内镜像源
1
| npm config set registry https://registry.npmmirror.com
|
1
| npm config set registry https://npm.aliyun.com
|
1
| npm config set registry http://mirrors.cloud.tencent.com/npm/
|
1
| npm config set registry https://mirrors.huaweicloud.com/repository/npm/
|
GIT Proxy
查看当前代理
1
| git config --global --list
|
取消代理
1
| git config --global --unset http.proxy; git config --global --unset https.proxy
|
配置 HTTP 代理
以下代码仅为示例,请根据实际的 Windows 代理地址和端口填写!
如何查看 Windows 代理的地址和端口?
- 打开「控制面板」窗口
- 选择「网络和 Internet」选项
- 选择「Internet 选项」,弹出「Internet 属性」窗口
- 切换到「连接」选项卡
- 点击「局域网设置 (L)」按钮,弹出「局域网 (LAN) 设置」窗口
- 在「代理服务器」中查看「地址 (E)」和「端口 (T)」
1
| git config --global http.proxy "http://127.0.0.1:10809"; git config --global https.proxy "http://127.0.0.1:10809"
|
pip 镜像
查看当前镜像源
返回 pip 官方源
1
| pip config unset global.index-url
|
使用国内镜像源
1
| pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
1
| pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple
|
1
| pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
|
1
| pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple
|
1
| pip config set global.index-url https://repo.huaweicloud.com/repository/pypi/simple/
|
1
| pip config set global.index-url https://pypi.douban.com/simple
|