npm 镜像配置

永久使用:

  npm config set registry URL (URL 即为需要设置的镜像站点地址)

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

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

  npm config get registry 返回 https://registry.npm.taobao.org 即设置成功

  npm config get disturl 返回 https://npm.taobao.org/dist 即设置成功

临时使用:

  npm install xxx --registry=https://registry.npm.taobao.org

使用 cnpm:

  npm install cnpm -g

  React Native 官网 搭建开发环境 不建议使用 cnpm

猜你喜欢

转载自www.cnblogs.com/WEB-PHP/p/11362710.html