           if packagePath = @getPackageCachePath(packageName, packageVersion)
             callback(null, packagePath)
           else
-            @downloadPackage(tarball, callback)
+            @downloadPackage(tarball, installGlobally, callback)
         installNode = options.installNode ? true
         if installNode
           commands.push (packagePath, callback) =>

  # Download a package tarball.
  #
  # packageUrl - The string tarball URL to request
  # callback - The function to invoke when the request completes with an error
  #            as the first argument and a string path to the downloaded file
  #            as the second.
  downloadPackage: (packageUrl, callback) ->
    requestSettings =
      url: packageUrl
      proxy: process.env.http_proxy || process.env.https_proxy

          try
            error = JSON.parse(Buffer.concat(chunks))
            message = error.message ? error.error ? error
            process.stdout.write('\u2717\n'.red) if installGlobally
            callback("Unable to download #{packageUrl}: #{response.headers.status ? response.statusCode} #{message}")
          catch parseError
            process.stdout.write('\u2717\n'.red) if installGlobally
            callback("Unable to download #{packageUrl}: #{response.headers.status ? response.statusCode}")

  # Get the path to the package from the local cache.
