Home > Web Front-end > JS Tutorial > body text

Introduction and usage of domestic NPM images provided by Taobao_Basic knowledge

WBOY
Release: 2016-05-16 16:52:13
Original
1557 people have browsed it

Taobao’s NPM image is a complete npmjs.org image. You can use this instead of the official version (read-only). The synchronization frequency is currently every 15 minutes to ensure that it is as synchronized with the official service as possible.

1. The current registry.npm.taobao.org is fully synchronized from registry.npmjs.org.
2. The current running version of npm.taobao.org is: cnpmjs.org@0.4.1
3. The system runs on Node.js@v0.11.12.

Instructions for use

The default npm can be replaced by the customized cnpm (gzip compression support) command line tool:

Copy the code The code is as follows:
$ npm install -g cnpm --registry=http://registry.npm.taobao.org

Or add alias:
Copy code The code is 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 cnpmnalias cnpm="npm --registry=registry.npm.taobao.org
--cache=$HOME/. npm/.cache/cnpm
--disturl=http://dist.cnpmjs.org
--userconfig=$HOME/.cnpmrc"' >> ~/.zshrc && source ~/.zshrc

Install template

Install all modules from registry.npm.taobao.org. When installing, it is found that the installed modules have not been synchronized. Taobao NPM will automatically synchronize in the background, and will let you proceed from the official NPM registry.npmjs.org Install. Next time you install this module, it will be installed directly from Taobao NPM.

Copy the code The code is as follows:
$ cnpm install [name]

Sync module

Synchronize a module immediately through the sync command. Only the cnpm command line has this function:

Copy the code The code is as follows:
$ cnpm sync connect

Of course, you can synchronize directly through the web: npm.taobao.org/sync/connect
Copy code The code is as follows:

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

Other commands

Supports all npm commands except publish, such as:

Copy the code The code is as follows:
$ cnpm info connect

Related labels:
npm
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!