一、原始方式切换 查看当前源。 npm config get registry 切换淘宝源。 npm config set registry https://registry.npmmirror.com 二、NRM包切换 安装NRM依赖。 npm install -g nrm 查看可选的源。 nrm ls 切换源(输入上述图片中对应名称)。 nrm use taobao 测试速度(所有源的响应时间)。 根据源的响应时间长短选择最快的源使用即可。 nrm test