npm 镜像等设置

npm 镜像等设置
本页内容

中国加速镜像

  1. npm可能未及时同步
  2. pip可能未同步官方已经删除的恶意软件包
manageruseful commandscommand
pnpmpnpm get registrypnpm config set registry https://registry.npmmirror.com
npmnpm get registrynpm config set registry https://registry.npmmirror.com
yarnyarn config get registryyarn config set registry https://registry.npmmirror.com
pippip 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

代理

注意如果你没有翻墙软件就不用做下面的配置,请将地址修改为你实际的代理地址。

  1. npm(~/.npmrc)

    1proxy=http://localhost:8118
    2https_proxy=https://localhost:8118
    3strict-ssl=false
    
  2. yarn(~/.yarnrc)

    1env:
    2    proxy 'http://localhost:8118'
    3    https_proxy 'https://localhost:8118'
    4    strict-ssl false