1. 得到原本的镜像地址
npm get registry
> https://registry.npmjs.org/
2. 切换到淘宝源
npm --registry https://registry.npm.taobao.org install node-red-contrib-composer@latest
npm config set registry http://registry.npm.taobao.org/
3.全局配置切换到官方源
npm config set registry https://registry.npmjs.org/
4. 检测是否切换到了淘宝源
npm info underscore
gitHead: 'e4743ab712b8ab42ad4ccb48b155034d02394e4d',
dist:
{ shasum: '4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022',
size: 34172,
noattachment: false,
tarball: 'http://registry.npm.taobao.org/underscore/download/underscore-1.8.3.tgz' },
directories: {},
publish_time: 1427988774520 }