1、设置全局安装路径:
npm config set cache "D:\nodejs\node_cache"
npm config set prefix "D:\nodejs\node_global"
2、配置npm淘宝镜像源:(多种方式介绍:https://blog.csdn.net/pj598707063/article/details/104257111)
npm config set registry https://registry.npmmirror.com
中国镜像站:https://npmmirror.com/
https://www.php.cn/js-tutorial-414607.html