text: // In yarn (up to v1.22.4 we use), there is a bug when you tries to
  // execute custom install command from a workspace environment:
  // https://github.com/yarnpkg/yarn/issues/4564. For now, we will
  // have to patch the code so a symlink is created. This bug only
  // affects Windows environment.
  
  const fs = require("fs");
  const path = require("path");
  
  if (process.platform !== "win32") {
    return;
  }
  
  const rootPath = path.resolve(path.join(__dirname, ".."));
  const nodeModulesPath = path.join(rootPath, "node_modules");
  const nestedPath = path.join(nodeModulesPath, "node_modules");
  
  fs.mkdirSync(nodeModulesPath, { recursive: true });
  
  try {
    fs.unlinkSync(nestedPath);
  } catch (error) {
    if (error.code !== "ENOENT") {
      console.log(`Error removing previous symlink: ${error}`);
      process.exit(1);
    }
  }
  
  try {
    fs.symlinkSync(nodeModulesPath, nestedPath, "junction");
  } catch (error) {
    console.log(`Error creating symlink: ${error}`);
    process.exit(1);
  }
  