npm modify image source

Background: It is common to switch npm image sources. The specific operation commands are recorded below.

1. Open a terminal and run the "npm config get registry" command to view the currently configured image source.

npm config get registry

img

2. Modify to Taobao mirror source "https://registry.npmjs.org/"

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

img

3. Check the modification results to prove that the modification has been successful.

npm config get registry

img

The mirror source of npm has been changed to the mirror source you set, and npm will use the new mirror source to download the package

4. Change back to the official image source

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

img

You're doneEND!

Guess you like

Origin blog.csdn.net/c103363/article/details/136060094