Package Manager Domestic Source
Using package management can greatly reduce the cost of referencing and managing third-party libraries, but many sources are abroad, and it is easy to time out when installing through package management; we can solve this problem by modifying it to a domestic source or using a proxy.
pip
provider | Source and usage |
---|---|
Douban | https://pypi.doubanio.com/simple/ pip install -i https://pypi.doubanio.com/simple/ |
Tsinghua University | https://pypi.tuna.tsinghua.edu.cn/simple pip install -i https://pypi.tuna.tsinghua.edu.cn/simple |
Alibaba Cloud | https://mirrors.aliyun.com/pypi/simple/ pip install -i https://mirrors.aliyun.com/pypi/simple/ |
Composer
provider | Source and usage |
---|---|
- | https://packagist.phpcomposer.com/ composer config -g repo.packagist composer https://packagist.phpcomposer.com |
- | https://php.cnpkg.org/ composer config -g repo.packagist composer https://php.cnpkg.org |
Alibaba Cloud | https://mirrors.aliyun.com/composer/ composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ |
Huawei Cloud | https://mirrors.huaweicloud.com/repository/php/ composer config -g repo.packagist composer https://mirrors.huaweicloud.com/repository/php/ |
Shanghai Jiaotong University | https://packagist.mirrors.sjtug.sjtu.edu.cn/ composer config -g repo.packagist composer https://packagist.mirrors.sjtug.sjtu.edu.cn |
- | https://packagist.jp/ composer config -g repo.packagist composer https://packagist.jp |
NPM
provider | Source and usage |
---|---|
Taobao | https://registry.npm.taobao.org/ npm config set registry https://registry.npm.taobao.org yarn config set registry https://registry.npm.taobao.org |
- | http://r.cnpmjs.org/ npm config set registry http://r.cnpmjs.org/ yarn config set registry http://r.cnpmjs.org/ |
Gem
provider | Source and usage |
---|---|
Ruby China | https://ruby.taobao.org/ gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/ |
Tsinghua University | https://mirrors.tuna.tsinghua.edu.cn/rubygems/ gem sources --add https://mirrors.tuna.tsinghua.edu.cn/rubygems/ --remove https://rubygems.org/ |
Maven
provider | Source and usage |
---|---|
Alibaba Cloud | http://maven.aliyun.com/nexus/content/groups/public/ <?xml version="1.0" encoding="UTF-8"?> |
proxy settings
package manager | form of proxy | use |
---|---|---|
pip | http/https | https_proxy=http://ip:hort pip install |
composer | http/https | https_proxy=http://ip:hort composer install |
npm | http/https | npm config set proxy http://ip:port yarn config set proxy http://ip:port |
gem | http/https | http_proxy=http://ip:host https_proxy=https://ip:host gem install |
go | http/https | http_proxy=http://ip:host https_proxy=https://ip:host go get |