mirror of
https://github.com/nexu-io/open-design.git
synced 2026-06-01 03:14:35 +07:00
fix(tools-dev): use junction instead of dir symlink on Windows (#231)
ensureWebDevNodeModules() called fs.symlink(target, path, "dir") to
link apps/web/node_modules into the web runtime root. On Windows,
"dir" symlinks require either Administrator rights or Developer Mode
(SeCreateSymbolicLinkPrivilege). Standard non-elevated user accounts
without Developer Mode get EPERM and tools-dev exits before web ever
starts.
Junctions ("junction") are functionally equivalent for directory-only
links on the same volume, work for any user without elevation or
Developer Mode, and are silently treated as plain symlinks on POSIX.
The existing isSymbolicLink() check on the next launch still matches
junctions on Node.
Reproduced on Windows 11 + Node 24 with a non-elevated PowerShell
session and Developer Mode off.
This commit is contained in:
parent
4510c69ba1
commit
a4fd4f949f
1 changed files with 1 additions and 1 deletions
|
|
@ -479,7 +479,7 @@ async function ensureWebDevNodeModules(config: ToolDevConfig): Promise<void> {
|
|||
const current = await lstat(runtimeNodeModules).catch(() => null);
|
||||
if (current?.isSymbolicLink()) return;
|
||||
if (current != null) await rm(runtimeNodeModules, { force: true, recursive: true });
|
||||
await symlink(webNodeModules, runtimeNodeModules, "dir");
|
||||
await symlink(webNodeModules, runtimeNodeModules, "junction");
|
||||
}
|
||||
|
||||
async function writeWebDevTsconfig(config: ToolDevConfig): Promise<void> {
|
||||
|
|
|
|||
Loading…
Reference in a new issue