Problems encountered

npm install Copy the code

When installing the Node tool, the progress bar is stuck because the installation package is too large. I believe many friends have encountered this problem. The reason should be that the NPM speed of the domestic network connection is slow, and even many things can not be downloaded and installed. So how to solve this problem?


Solution 1: Install a domestic mirror

This is a common method, and I first used this CNPM installation method. This is the domestic mirror, the loading speed is obviously much faster than foreign, and CNPM has an obvious progress bar, it is convenient for us to check the installation progress (such as 6/11). For others, see npm.taobao.org/

npm install -g cnpm --registry=https://registry.npm.taobao.orgCopy the code

CMD enter the above command is ok, and then enter

cnpm install Copy the code

The following operations are similar to those without mirroring.

Scheme 2: Use the proxy Registry

After looking up some information on the Internet, I found that we can use the proxy method, the method is also very simple:

npm config set registry https://registry.npm.taobao.orgCopy the code

However, subsequent commands such as install still work through NPM, not CNPM.