docs: function (pkg, cb) {
    var auto = npm.config.get("auto-activate")
    if (!auto) {
      autoActivate = function (_, cb) { return cb() }
      return log.verbose("auto-activate", "disabled by config", cb)
    }
    pkg = pkg && pkg._data || pkg
    // get the list of versions of this package.
    readInstalled(pkg.name, function (er, inst) {
      if (er) return cb(er)
      var versions = Object.keys(inst)
      if (auto !== "always" && versions.indexOf("active") !== -1) {
        log("another version already active", "auto-activate")
        log("to activate, do:   npm activate "+
          pkg.name+"@"+pkg.version, "auto-activate")
        return cb()
      }
      var u = pkg.name+"@"+pkg.version
      log.verbose(u, "auto-activate")
      npm.commands.activate([u], function (er) {
        // don't rollback the whole install if the activate fails.
        if (er) log.error(er, "Failed to update "+u)
        cb()
      })
    })
  }