Taobao provides a brief introduction of domestic NPM mirroring and how to use the basic knowledge

Source: Internet
Author: User

The NPM image of Taobao is a complete npmjs.org mirror image. You can use this instead of the official version (read only), the sync frequency is currently 15 minutes to ensure that as far as possible with the official service synchronization.

1. The current registry.npm.taobao.org is a full volume synchronization from the registry.npmjs.org.
2. The current npm.taobao.org run version is: cnpmjs.org@0.4.1
3. The system runs on the node.js@v0.11.12.

Instructions for use

The default NPM can be replaced by a custom CNPM (gzip compression support) command-line tool:

Copy Code code as follows:
$ NPM install-g cnpm--registry=http://registry.npm.taobao.org

Or add an alias:
Copy Code code as follows:

Alias cnpm= "NPM--registry=http://registry.npm.taobao.org \
--cache= $HOME/.npm/.cache/cnpm \
--disturl=http://dist.cnpmjs.org \
--userconfig= $HOME/.CNPMRC "

#Or alias it in. BASHRC Or. ZSHRC
$ Echo ' \n#alias for Cnpm\nalias cnpm= ' npm--registry=registry.npm.taobao.org \
--cache= $HOME/.npm/.cache/cnpm \
--disturl=http://dist.cnpmjs.org \
--userconfig= $HOME/.cnpmrc "' >> ~/.zshrc && source ~/.ZSHRC

Installation templates

Install all modules from registry.npm.taobao.org. When the installation of the module is found not synchronized, Taobao NPM will automatically sync in the background, and will allow you to install from the official NPM registry.npmjs.org. The next time you install this module, it will be installed directly from the Taobao NPM.

Copy Code code as follows:
$ cnpm Install [name]

Sync Module

Synchronize a module directly through the Sync command, only the CNPM command line has this function:

Copy Code code as follows:
$ cnpm Sync Connect

Of course, you can sync directly with the Web: npm.taobao.org/sync/connect
Copy Code code as follows:

$ open Http://npm.taobao.org/sync/connect

Other commands

Supports NPM except publish for all commands, such as:

Copy Code code as follows:
$ CNPM Info Connect

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.