Home Web Front-end JS Tutorial Introduction and usage of domestic NPM images provided by Taobao_Basic knowledge

Introduction and usage of domestic NPM images provided by Taobao_Basic knowledge

May 16, 2016 pm 04:52 PM
npm

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

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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What to do if npm react installation error occurs What to do if npm react installation error occurs Dec 27, 2022 am 11:25 AM

What to do if npm react installation error occurs

JavaScript package managers compared: Npm vs Yarn vs Pnpm JavaScript package managers compared: Npm vs Yarn vs Pnpm Aug 09, 2022 pm 04:22 PM

JavaScript package managers compared: Npm vs Yarn vs Pnpm

An article analyzing package.json and package-lock.json An article analyzing package.json and package-lock.json Sep 01, 2022 pm 08:02 PM

An article analyzing package.json and package-lock.json

What should I do if node cannot use npm command? What should I do if node cannot use npm command? Feb 08, 2023 am 10:09 AM

What should I do if node cannot use npm command?

Let's talk about npm configuration of domestic mirrors (Taobao mirrors) Let's talk about npm configuration of domestic mirrors (Taobao mirrors) Aug 09, 2022 pm 12:06 PM

Let's talk about npm configuration of domestic mirrors (Taobao mirrors)

What to do if npm node gyp fails What to do if npm node gyp fails Dec 29, 2022 pm 02:42 PM

What to do if npm node gyp fails

This article will help you understand the principles of npm This article will help you understand the principles of npm Aug 09, 2022 am 09:23 AM

This article will help you understand the principles of npm

What is the relationship between npm and node.js? What is the relationship between npm and node.js? Jul 11, 2022 pm 06:00 PM

What is the relationship between npm and node.js?

See all articles