     @plugins_ = null
     # @private {?Array<Object>} mirror information
     @mirrors_ = null
-    # @private {?Object} selected mirror
-    @mirror_ = null
+    # @private {?Object} npm config
+    @config_ =
+      mirror: null
+      proxy: null
 
     # @const
     @VALID = 0

          icon: path.join ROOT, 'assets', 'img', 'material', '7_big.png'
          audio: "file://#{ROOT}/assets/audio/fail.mp3"

pluginManager = new PluginManager path.join(ROOT, 'plugin.json'), PLUGIN_PATH,
  path.join(ROOT, 'mirror.json')

module.exports = pluginManager

  # @retrun {Promise<Array<Object>>}
  readMirrors: ->
    fs.readJsonAsync(@mirrorPath).then (@mirrors_) =>
      mirrorConf = config.get 'packageManager.mirrorName', if navigator.language is 'zh-CN' then  "taobao" else "npm"
      proxyConf = config.get "packageManager.proxy", false
      @selectConfig(mirrorConf, proxyConf).then =>
        @mirrors_

  # select a mirror and set proxy config
  # @param {object, object} mirror name, is proxy enabled
  # @return {Promise<Object>} return the npm config
  selectConfig: (name, enable) ->
    @getMirrors().then =>
      @config_.mirror = @mirrors_[name]
      config.set "packageManager.mirrorName", name
      @config_.proxy = enable
      config.set "packageManager.proxy", enable
      new Promise (resolve) =>
        npmConfig =
          prefix: PLUGIN_PATH
          registry: @config_.mirror.server
        if @config_.proxy
          npmConfig.http_proxy = 'http://127.0.0.1:12450'
        npm.load npmConfig, =>
          resolve @config_

  # set the update relative information to plugins
  # @return {Promise<>}
