npm cannot download dependencies normally, change Taobao mirror source

Because of the domestic network environment, when downloading npm packages, we often encounter situations where they cannot be downloaded normally. Domestic Taobao launched the npm mirror, which is a complete npmjs.org mirror. The synchronization frequency is 15 minutes to ensure synchronization with the official service. It is recommended to use this image. The method of use is as follows:

Enter the following command to switch to Taobao mirror source:

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

All the npm commands used afterwards can be replaced by cnpm for installation.

Guess you like

Origin blog.csdn.net/wwqcherry/article/details/106191005