_writeManifest(label, type, manifest) {
    process.chdir(this.rootPath);
    let outputDir = quickTemp.makeOrReuse(this.dirs, label);
    process.chdir(originalWorkingDirectory);

    this._conf.set(label, outputDir);

    let outputFile = path.join(outputDir, translate(type, 'manifest'));
    fs.outputFileSync(outputFile, manifest);

    // Remove any existing yarn.lock file so that it doesn't try to incorrectly use it as a base.
    if (type === 'yarn') {
      try {
        fs.unlinkSync(path.join(outputDir, 'yarn.lock'));
      } catch (error) {
        // Catch unexceptional error but rethrow if something is truly wrong.
        if (error.code !== 'ENOENT') {
          throw error;
        }
      }
    }
  }
The `_writeManifest` method generates the on-disk folder for the package cache
and saves the manifest into it. If it is a yarn package cache it will remove
the existing lock file.

@private
@method _writeManifest
@param {String} label The label for the cache.
@param {String} type The type of package cache.
@param {String} manifest The contents of the manifest file to write to disk.