Switch NPM source to Taobao source

npm config set registry https://registry.npm.taobao.org
Copy the code

View the source of NPM

npm config get registry
Copy the code

The use of CNPM

Install CNPM

CNPM can be used instead of NPM

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

Copy the code

nrm

The installation

npm install -g nrm

Copy the code

Displays the source address used

nrm ls
Copy the code

Switch the source

When using NPM to download packages, use CNPM’s image source to download things

nrm use cnpm
Copy the code

Know the download speed of each source

nrm test
Copy the code