         else
           deferred.resolve()
         return deferred.promise
-      saveCurrentDependencyToJson cacheName, version
+      saveCurrentDependencyToJson name, version
     else
       saveBowerJson()
 

      if isSerialInstall
        for key in Object.keys(installed)
          i = installed[key]
          log.i "Installed: #{i.pkgMeta.name}##{i.pkgMeta.version}#{if offline then " (offline)"}"
        hasDependencies = Object.keys(installed).length > 1
        if cached and validate and !hasDependencies
          # Installed with cache, but validation occurred

  log = new Logger logLevel, 'Bower'

  bowerInstallDependency = (item, cb) ->
    Q.fcall checkCache, item
    .then install
    .catch (error) ->
      log.e "Install failed: #{item.name}: #{if error.stack then error.stack else error}" if error
      common.setExitCode 1
    .done ->
      if !common.hasError() and !fs.existsSync "bower_components/#{item.name}"
        log.e "Install failed: module does not exist: #{item.name}"
        common.setExitCode 1
      cb?()

