getRegistryByType(key) {
    switch (key) {
      case 'china':
        return 'https://registry.npmmirror.com';
      case 'npm':
        return 'https://registry.npmjs.org';
      default: {
        if (/^https?:/.test(key)) {
          return key.replace(/\/$/, '');
        }
        // support .npmrc
        const home = homedir();
        let url = process.env.npm_registry || process.env.npm_config_registry || 'https://registry.npmjs.org';
        if (fse.existsSync(path.join(home, '.cnpmrc')) || fse.existsSync(path.join(home, '.tnpmrc'))) {
          url = 'https://registry.npmmirror.com';
        }
        url = url.replace(/\/$/, '');
        return url;
      }
    }
  }
get registryUrl by short name
@param {String} key - short name, support `china / npm / npmrc`, default to read from .npmrc
@return {String} registryUrl