[remix] Ensure the symlink directory exists in ensureSymlink() (#11205)

Customer reported an edge case where (in a monorepo) their project's
`package.json` did not list any dependencies (instead they are listed at
the root-level `package.json`) and this caused the `node_modules`
directory to not exist in the app subdirectory, causing
`ensureSymlink()` to fail.
This commit is contained in:
Nathan Rajlich
2024-02-29 10:44:18 -08:00
committed by GitHub
parent de2738ba06
commit 6ed0fe6fb1
3 changed files with 19 additions and 0 deletions

View File

@@ -359,6 +359,7 @@ async function ensureSymlink(
}
}
await fs.mkdir(symlinkDir, { recursive: true });
await fs.symlink(relativeTarget, symlinkPath);
debug(`Created symlink for "${pkgName}"`);
}