一、淘宝镜像:

  1. 临时使用:

    1. npm --registry https://registry.npm.taobao.org install express
  2. 持久使用:

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

    二、使用cnpm:

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

    三、使用nrm — NPM registry 管理工具

bogon:bilibili cuiliang$ nrm use taobao

Registry has been set to: https://registry.npm.taobao.org/

bogon:bilibili cuiliang$ nrm ls

npm ———— https://registry.npmjs.org/ yarn ———- https://registry.yarnpkg.com/ cnpm ———- http://r.cnpmjs.org/