   # 0: not installed 1: installing 2: installed
   installStatus.push 0
 
+npmConfig = {
+  prefix: "#{PLUGIN_PATH}",
+  registry: mirror[config.get "packageManager.mirror", 0].server,
+  http_proxy: 'http://127.0.0.1:12450'
+}
+
 getAuthorLink = (author, link) ->
   handleClickAuthorLink = (e) ->
     shell.openExternal e.target.dataset.link

    if !@props.disabled
      removeStatus = @state.removeStatus
      removeStatus[index] = 1
      npm.load {prefix: "#{PLUGIN_PATH}", registry: mirror[@state.mirror].server, http_proxy: 'http://127.0.0.1:12450'}, (err) ->
        npm.commands.uninstall [plugins[index].packageName], (er, data) ->
          callback(index)
      @setState {removeStatus}

      checking: false
      isUpdateAvailable: isUpdateAvailable
  checkUpdate: (callback, isfirst) ->
    npm.load npmConfig, (err) ->
      npm.config.set 'depth', 1
      npm.commands.outdated [], (er, data) ->
        callback(data, isfirst)
