中國加速鏡像
- npm可能未及時同步
- pip可能未同步官方已經刪除的惡意軟件包
manager | useful commands | command |
---|---|---|
pnpm | pnpm get registry | pnpm config set registry https://registry.npmmirror.com |
npm | npm get registry | npm config set registry https://registry.npmmirror.com |
yarn | yarn config get registry | yarn config set registry https://registry.npmmirror.com |
pip | pip config list | # for pip install pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ # for pip search pip config set global.index https://mirrors.aliyun.com/pypi pip config set global.trusted-host mirrors.aliyun.com |
代理
注意如果你沒有翻牆軟件就不用做下面的配置,請將地址修改爲你實際的代理地址。
npm(~/.npmrc)
1proxy=http://localhost:8118 2https_proxy=https://localhost:8118 3strict-ssl=false
yarn(~/.yarnrc)
1env: 2 proxy 'http://localhost:8118' 3 https_proxy 'https://localhost:8118' 4 strict-ssl false