From 2aaf0a0d54a472769cea7e898f62ba84ff498032 Mon Sep 17 00:00:00 2001 From: Gaubee Date: Sat, 22 Mar 2025 21:10:58 +0800 Subject: [PATCH] fix(symlink): use junction type for Windows compatibility with pnpm When creating symlinks on Windows without explicit `junction` type, the default behavior may trigger EPERM errors under pnpm environments. This fix ensures cross-platform compatibility by enforcing junction type as default on Windows. --- lib/copy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/copy.js b/lib/copy.js index a98414b..b751d32 100644 --- a/lib/copy.js +++ b/lib/copy.js @@ -386,7 +386,7 @@ function copyFile(srcPath, destPath, stats, options) { function copySymlink(srcPath, destPath, stats, options) { return readlink(srcPath) .then(function(link) { - return symlink(link, destPath); + return symlink(link, destPath, options?.symlinkType ?? 'junction'); }); }