       else
         callback("#{stdout}\n#{stderr}")
 
-  installModule: (options, pack, modulePath, callback) ->
+  installModule: (options, pack, modulePath, destination=@atomPackagesDirectory, callback) ->
     installArgs = ['--globalconfig', config.getGlobalConfigPath(), '--userconfig', config.getUserConfigPath(), 'install']
     installArgs.push(modulePath)
     installArgs.push("--target=#{@electronVersion}")

CSON = require 'season'
semver = require 'npm/node_modules/semver'
temp = require 'temp'

config = require './apm'
Command = require './command'

      process.env.NODE_DEBUG = 'request'

    installPackage = (name, callback) =>
      gitPackageInfo = @getHostedGitInfo(name)
      targetDir = path.join(@atomGitPackagesDirectory, gitPackageInfo.project)

      if gitPackageInfo
        @installGitPackage gitPackageInfo, targetDir, (error) =>
          return callback(error) if error?
          pack =
            name: gitPackageInfo.project
          @installModule options, pack, targetDir, @atomGitPackagesDirectory, callback
      else if name is '.'
        @installDependencies(options, callback)
      else # is registered package
        atIndex = name.indexOf('@')
        if atIndex > 0
          version = name.substring(atIndex + 1)
