   installPlugin: (name) ->
     @getMirrors().then =>
       new Promise (resolve) =>
-        npm.commands.install [name], =>
+        npm.commands.install [name], (err) =>
           plugin = @readPlugin_ path.join @pluginPath, 'node_modules', name
           @plugins_.push plugin
-          resolve plugin
+          if !err then resolve plugin else reject()
 
   # uninstall one plugin, this won't unload it from memory
   # @param {Plugin} plugin

    # after getting mirrors, at least one mirror is set
    @getMirrors().then =>
      new Promise (resolve) =>
        npm.commands.outdated [], (err, data) =>
          # data is an Array<Array<>> represents outdated plugins
          # each element of data is in this format
          # [
          #   path,
          #   packageName,
          #   currentVersion,
          #   wantedVersion,
          #   lastestVersion,
          #   "lastest"
          # ]
          names = data.map (item) -> item[1]
          @getInstalledPlugins().then (plugins) ->
            resolve plugins.filter (plugin) -> plugin.packageName in names

  # get all plugins which match a filer function
  # @param {!function(Plugin): boolean} filter


    plugin.isInstalled = true
    plugin.isOutdated = false
    if plugin.packageData?.version?
      plugin.version = plugin.packageData.version
    plugin.lastestVersion = plugin.version
    return plugin

  # notify user about unread plugins, only shown when any exists
