一、npm

  1. npm config set registry https://registry.npm.taobao.org --global
  2. npm config set disturl https://npm.taobao.org/dist --global

二、cnpm

  1. npm install -g cnpm --registry=https://registry.npm.taobao.org

三、yarn

  1. cnpm i yarn -g
  2. yarn config set registry https://registry.npm.taobao.org
  3. yarn add koa
  4. yarn remove koa
  1. npm cnpm yarn
  2. npm init -y cnpm init -y yarn init -y
  3. npm i koa -S cnpm i koa -S yarn add koa
  4. npm uninstall koa -S cnpm uninstall koa -S yarn remove koa