淘宝 NPM 镜像(原文链接:https://npm.taobao.org/)

使用说明

1、使用定制的cnpm(gzip压缩支持)命令工具代替默认的npm:

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

2、直接添加npm参数alias

alias cnpm="npm --registry=https://registry.npm.taobao.org \
--cache=$HOME/.npm/.cache/cnpm \
--disturl=https://npm.taobao.org/dist \
--userconfig=$HOME/.cnpmrc"

# Or alias it in .bashrc or .zshrc
$ echo '\n#alias for cnpm\nalias cnpm="npm --registry=https://registry.npm.taobao.org \
  --cache=$HOME/.npm/.cache/cnpm \
  --disturl=https://npm.taobao.org/dist \
  --userconfig=$HOME/.cnpmrc"' >> ~/.zshrc && source ~/.zshrc

posted @ 2017-08-01 11:29  小小07  阅读(3917)  评论(0编辑  收藏  举报