Beta

包管理 #开发

使用包管理可以大大降低引用和管理第三方库的成本,但是很多源都在国外,通过包管理安装的时候,容易超时;我们可以通过修改为国内源,或者使用代理来解决这个问题。

国内源

Pip

官网:https://pypi.org/

提供方源及使用方式
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple
阿里云 http://mirrors.aliyun.com/pypi/simple/
pip install -i http://mirrors.aliyun.com/pypi/simple/
豆瓣 https://pypi.doubanio.com/simple/
pip install -i https://pypi.doubanio.com/simple/

Composer

官网:https://packagist.org/

提供方源及使用方式
phpcomposer https://packagist.phpcomposer.com
composer config -g repo.packagist composer https://packagist.phpcomposer.com
cnpkg https://php.cnpkg.org/
composer config -g repo.packagist composer https://php.cnpkg.org/
阿里云 https://mirrors.aliyun.com/composer/
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
华为云 https://mirrors.huaweicloud.com/repository/php/
composer config -g repo.packagist composer https://mirrors.huaweicloud.com/repository/php/
上海交通大学 https://packagist.mirrors.sjtug.sjtu.edu.cn/
composer config -g repo.packagist composer https://packagist.mirrors.sjtug.sjtu.edu.cn/
packagist.jp https://packagist.jp/
composer config -g repo.packagist composer https://packagist.jp/

NPM

官网:https://www.npmjs.com/

提供方源及使用方式
淘宝 https://registry.npm.taobao.org/
npm config set registry https://registry.npm.taobao.org
yarn config set registry https://registry.npm.taobao.org
cnpmjs http://r.cnpmjs.org/
npm config set registry http://r.cnpmjs.org/
yarn config set registry http://r.cnpmjs.org/

Gem

官网:https://rubygems.org/

提供方源及使用方式
Ruby China https://ruby.taobao.org/
gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
清华大学 https://mirrors.tuna.tsinghua.edu.cn/rubygems/
gem sources --add https://mirrors.tuna.tsinghua.edu.cn/rubygems/ --remove https://rubygems.org/

Maven

官网:https://rubygems.org/

提供方源及使用方式
阿里云 http://maven.aliyun.com/nexus/content/groups/public/
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <mirrors>
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>
    </mirror>
  </mirrors>
  <profiles>
    <profile>
        <repositories>
          <repository>
            <id>central</id>
            <name>Maven Repository Switchboard</name>
            <layout>default</layout>
            <url>http://repo1.maven.org/maven2</url>
            <snapshots>
              <enabled>false</enabled>
            </snapshots>
          </repository>
        </repositories>
        <id>offical</id>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>offical</activeProfile>
  </activeProfiles>
</settings>
                        

Chocolatey

代理设置

包管理器代理方式使用方式
piphttp/httpshttps_proxy=http://ip:hort pip install
composerhttp/httpshttps_proxy=http://ip:hort composer install
npmhttp/https npm config set proxy http://ip:port
npm config set https-proxy https://ip:port

yarn config set proxy http://ip:port
yarn config set https-proxy https://ip:port
gemhttp/httpshttp_proxy=http://ip:host https_proxy=https://ip:host gem install
gohttp/httpshttp_proxy=http://ip:host https_proxy=https://ip:host go get
继续对所向往的东西保持信念,即使现在没有,也许永远得不到。
——尼采
关于 - 定制 - 合作
© 2019-2024 ® , 版权所有.
Powered by WINGEASE
ICP备案: 京ICP备11004781号-11
京公网安备 11010502050752号