     catch error
       plugin = isRead: false
       plugin.version = '0.0.0'
+
+    plugin.pluginPath = pluginPath
 
     try
       plugin.packageData = fs.readJsonSync path.join pluginPath, 'package.json'

    yield @getMirrors()
    try
      yield Promise.promisify(npm.commands.uninstall)([plugin.packageName])
      for plugin_, index in @plugins_
        if plugin.packageName is plugin_.packageName
          @plugins_.splice(index, 1)
          break
    catch error
      console.log "uninstallPlugin error: #{error}"
      console.log error.stack

  # @param {Plugin} plugin
  enablePlugin: (plugin) ->
    config.set "plugin.#{plugin.name}.enable", true
    @loadPlugin(plugin)

  # disable one plugin
  # @param {Plugin} plugin
  disablePlugin: (plugin) ->
    config.set "plugin.#{plugin.name}.enable", false
    @unloadPlugin(plugin)

  # load one plugin
  # @param {Plugin} plugin
  loadPlugin: (plugin) ->
    if plugin?.pluginDidLoad? then plugin.pluginDidLoad()

  # unload one plugin
  # @param {Plugin} plugin
  unloadPlugin: (plugin) ->
    if plugin.pluginShouldUnload? then plugin.pluginShouldUnload()

  removePlugin: (plugin) ->
    delete require.cache[require.resolve plugin.pluginPath]
    for plugin_, index in @plugins_
      if plugin.packageName == plugin_.packageName
        @plugins_.splice(index, 1)
        break

  addPlugin: (pluginPath) ->
    plugin = @readPlugin_ pluginPath
    @plugins_.push plugin
    @plugins_ = _.sortBy @plugins_, 'priority'
    if config.get "plugin.#{plugin.name}.enable", true
      @loadPlugin(plugin)

  reloadPlugin: (plugin) ->
    @unloadPlugin(plugin)
    newPlugin = {}
    delete require.cache[require.resolve plugin.pluginPath]
    for plugin_, index in @plugins_
      if plugin.packageName == plugin_.packageName
        newPlugin = @readPlugin_ plugin.pluginPath
        @plugins_[index] = newPlugin
        break
    if config.get "plugin.#{newPlugin.name}.enable", true
      @loadPlugin(newPlugin)
    @plugins_ = _.sortBy @plugins_, 'priority'

  # read a plugin from file system
  # @param {string} pluginPath path to a plugin directory
