设置npm的默认源

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

设置为淘宝的npm镜像

npm config set registry https://registry.npmmirror.com/

时临时改变源

npm install <package_name> --registry=https://registry.npmmirror.com/