The Taobao NPM mirror site has officially been in service to the outside world since 2014. At the beginning, it was simply intended to be a Chinese mirror site for NPM and give back to the domestic front-end community. Unknowingly, it has been running until now. Referring to the Ruby Gems Taobao mirror method, we applied for the second-level domain name of taobao.org with the Alibaba open source organization. The name of the mirror site was naturally named Taobao NPM Mirror Site (hereinafter referred to as CNPM).
Front-end (vue) entry to mastery course: Enter the study
as shown above. From 2014 when CNPM officially provided services to today, the number of NPM packages has gone from 100,000 to 1.78 million, and the number of CNPM package downloads back to the source has gone from 100 million to 20 billion. This is just The amount of data returned by the CDN to the origin site is even higher when calculated as the actual download volume.
It can be said without humility that CNPM has witnessed the vigorous development of domestic front-end in the past 8 years. In the future, we hope to continue to accompany China's front-end developers.
PS: Although most of the core participants are from major domestic manufacturers, CNPM itself is a neutral public welfare project, and the huge daily operation and maintenance costs come from community donations.
npm settings configure domestic mirror (Taobao mirror)
http://npm.taobao.org
and http://registry.npm.taobao.org
will be officially offline and stop DNS resolution on 2022.06.30.
The new domain name is npmmirror.com
. For related service domain name switching rules, please refer to:
http://npm.taobao.org => http://npmmirror.com http://registry.npm.taobao.org => http://registry.npmmirror.com
Modify npm to the new Taobao mirror source:
npm config set registry http://registry.npmmirror.com
needs to unmirror and restore to Official source:
npm config set registry https://registry.npmjs.org
Check whether the npm source address has been changed successfully:
npm config get registry
Configure the Taobao image and install it using cnpm
npm install -g cnpm --registry=https:// registry.npmmirror.com
recommends this method, which will not affect the npm command and does not require writing the Taobao address every time to install dependent packages.
cnpm installation mode
When cnpm is installed, all modules will be installed from the registry set here, that is, https://registry.npmmirror.com.
When installing, it is found that the installed modules have not been synchronized. Taobao NPM will automatically synchronize in the background and let you install it from the official NPM registry.npmjs.org. Next time you install this module, it will be installed directly from Taobao NPM.
Use cnpm
cnpm install xxx