hunk.code_window:   let packageJson = require("../package.json");
     try {
       await require("remix/magic").installMagicExports(
         path.resolve(__dirname, "..", "magicExports"),
         { [packageJson.name]: packageJson.version }
       );
     } catch (error) {
       if (error.code === "MODULE_NOT_FOUND") {
  
hunk.labels: keep keep keep keep replace replace keep keep keep
hunk.after_edit:       { [packageJson.name]: packageJson.version },
         path.resolve(__dirname, "..", "magicExports")
  
hunk.file_path: packages/remix-node/scripts/postinstall.ts
hunk.type: replace
file: #!/usr/bin/env node
  
  const path = require("path");
  const fs = require("fs-extra");
  const { execSync } = require("child_process");
  
  let buildDir = path.resolve(__dirname, "../../../build/node_modules");
  let installDir = path.resolve(__dirname, "../node_modules");
  
  async function run() {
    // Install all remix packages
    await fs.ensureDir(installDir);
    await fs.copy(buildDir, installDir);
  
    // Manually run postinstall for node + react
    execSync("node node_modules/@remix-run/node/scripts/postinstall.js");
    execSync("node node_modules/@remix-run/react/scripts/postinstall.js");
  }
  
  run().then(
    () => {
      process.exit(0);
    },
    error => {
      console.error(error);
      process.exit(1);
    }
  );
  