Set Taobao mirror command


As a foreign node warehouse installation tool, npm will naturally be interfered by the Great Firewall of China. When domestic users install related resources, the installation will fail and the speed will be very slow. In order to solve the problem of npm installation, there are many npm mirror URLs in China. Taobao 's npm mirror is used more frequently.

There are three methods I know of. The first is the two provided by Taobao npm :

 

1 ) You can use our custom cnpm  (gzip  compression support command line tool instead of default  npm: 

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

 

 

2 ) Directly point the local npm repository to the mirror address of Taobao

npm get registry 

> https://registry.npmjs.org

set to Taobao

npm config set registry http://registry.npm.taobao.org

 

 

replace with the original

npm config set registry https://registry.npmjs.org/

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324845884&siteId=291194637