1、全局仓库路径
npm config set prefix "D:\Program Files\nodejs\node_global"
2、缓存路径
npm config set cache "D:\Program Files\nodejs\node_cache"
1、临时
npm install xxx -g --registry=https://registry.npm.taobao.org
2、永久
npm config set registry https://registry.npm.taobao.org/
原文:https://www.cnblogs.com/xgege/p/13418518.html