yarn、npm、yum、pip镜像源

13 篇文章 0 订阅
11 篇文章 1 订阅

##########################################  yarn  #####################################

1.查看当前镜像源

yarn config get registry

2.临时修改yarn源

yarn save package_name --registry https://registry.npm.taobao.org/

3.修改yarn源为taobao源

yarn config set registry https://registry.npm.taobao.org/

4.修改yarn源为官方源

yarn config set registry https://registry.yarnpkg

##########################################  npm  #####################################

1.查看源:

npm config get registry

2.更改为npm淘宝源:

npm config set registry https://registry.npm.taobao.org

3.更改为npm官方源:

npm config set registry https://registry.npmjs.org

4.临时修改npm源

npm install module_name --registry https://registry.npm.taobao.org

##########################################  yum  #####################################

1.备份原有yum源:

mv /etc/yum.repos.d /etc/yum.repos.d.bak

2.创建yum源目录

mkdir /etc/yum.repos.d

3.下载阿里云yum源配置

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

4.重建缓存

yum clean all 
yum makecache

##########################################  pip  #####################################

1.临时

pip install package_name -i https://pypi.tuna.tsinghua.edu.cn/simple

2.永久修改:需要修改配置文件 

Windows:

1.进入%APPDATA%目录,例如我的是C:\Users\Raytine\AppData\Roaming

2.新建pip文件夹,如果有则跳过

3.进入pip文件夹,新建pip.ini文件,设置pip源,如下所示为清华大学的pip源:

[global] 
index-url=https://pypi.tuna.tsinghua.edu.cn/simple 
timeout = 6000

[install] 
trusted-host=pypi.tuna.tsinghua.edu.cn

disable-pip-version-check = true

 

Linux:

1.cd ~ # 进入家目录

2.mkdir .pip # 新建.pip隐藏文件夹

3.touch pip.conf # 进入.pip文件夹,新建pip.conf文件

4.vim pip.conf # 用vim编辑pip.conf文件,内容与Windows下pip.ini文件的内容一样

5.保存退出

 

其他国内pip源:

豆瓣 ··············· http://pypi.douban.com/

华中理工大学 ········ http://pypi.hustunique.com/

山东理工大学 ········ http://pypi.sdutlinux.org/

中国科学技术大学 ···· http://pypi.mirrors.ustc.edu/

阿里云 ············· http://mirrors.aliyun.com/pypi/simple/

清华大学 ··········· https://pypi.tuna.tsinghua.edu.cn/simple/

 

 

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

password-u

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值