 
     # The default version is `master`.
     @version = 'master' if not @version or @version is '*'
+    @remote = 'https://raw.github.com'
     logging.info "Installing #{@repo}@#{@version}..."
 
-    @remote = 'https://raw.github.com'
-    @slug = "#{@repo}@#{@version}"
-
-    # Use `repo@version` to de-duplicate in-flight requests.
-    if inFlight[@slug]
+    # De-duplicate in-flight requests.
+    if inFlight[@repo]
       @install = @emit.bind(@, 'end')
-    inFlight[@slug] = true
+    inFlight[@repo] = true
 
   dirname: ->
     sysPath.join(project.clientComponentsDir, @repo)

    if @repo.indexOf('/') < 0
      logging.fatal "Invalid repo: #{@repo}"

    # If pkgInfo is given, use it to create a local
    # `component.json` file, then fetch the required files.
    # Otherwise, fetch `component.json` from the remote repo.
    if @pkgInfo
      @writeJSON @processJSON
    else
      @getJSON @processJSON

  # Create a local `component.json` from pkgInfo.
  writeJSON: (callback) ->
    json = @pkgInfo
    callback(null, json)

  # Fetch `component.json` from the remote repo.
  getJSON: (done) ->
    url = @url('component.json')

    logging.info "fetching #{url}"
    request.get url, null, (err, content) ->
      if err
        done(err)
      else
        try
          json = JSON.parse(content)
          done(null, json)
        catch e
          logging.fatal "Failed to fetch #{url}"
          done(e)

  processJSON: (err, json) =>
    if err
      return @emit('error', err)

    files = []
    if json.main then files.push(json.main)
    if json.scripts then files = files.concat(json.scripts)

    files = _.uniq(files)

    async.parallel [
      # Get dependencies
      (done) =>
        if json.dependencies
          @getDependencies json.dependencies, done
        else
          done(null)

      # Download the files
      (done) =>
        async.each files, @getFile, done

      # Save component.json
      (done) =>
        fs.mkdirSync @dirname()
        @writeFile 'component.json', JSON.stringify(json, null, 2), done

    ], (err, results) =>
      if err then logging.fatal err
      @emit 'end'

  # Fetch a single file and write it to disk.
  getFile: (file, done) =>
    url = @url(file)
    logging.info "Fetching #{url}"

    # Create the dir
    dest = @join(file)
    fs.mkdirSync sysPath.dirname(dest)

    # Download the file and save it to disk.
    request.get url, dest, done

  # Write a file to disk.
  writeFile: (file, str, callback) ->
    file = @join(file)
    logging.info "Writing file #{file}"
    fs.writeFile file, str, callback

  # Install dependencies,
  getDependencies: (deps, callback) ->
    pkgs = []
    for repo, version of deps
      pkg = new Package(repo, version)
      pkgs.push pkg

    getPkg = (pkg, done) =>
