Method 1: Terminal changes the configuration file of npm
Query or verify the currently configured mirror:
npm config get registry
npm switches to Taobao image:
npm config set registry https://registry.npm.taobao.org
Method 2: Edit the npm configuration file directly
Modify the registry address directly
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/
electron_mirror=https://npm.taobao.org/mirrors/electron/
registry=https://registry.npm.taobao.org
Method 3: Use nrm to manage registry addresses
install nrm
npm install -g nrm
View mirror list
nrm ls
switch mirror
nrm use taobao