From a008269c621ee90585b73dc0a40b7cd1a2a470db Mon Sep 17 00:00:00 2001 From: Den Kong Date: Fri, 4 Sep 2026 12:43:47 +0800 Subject: [PATCH] fix: run mklink through cmd so windows install works npm install fails on Windows in postinstall with "mklink: command not found". mklink is a cmd.exe builtin rather than an executable, so the sh running this script cannot exec it, and every symlink the install needs is made this way. Routing it through cmd works. Verified on Windows 11 with git-bash: `mklink /J link src` reports command not found, `cmd //c mklink //J link src` reports "Junction created" and the junction resolves. Tested with the same relative paths symlink() passes, from a directory it has cd'd into. The doubled slashes are the usual MSYS escaping, and are safe here because this branch only runs when the OS was detected as cygwin or mingw. --- ci/build/npm-postinstall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build/npm-postinstall.sh b/ci/build/npm-postinstall.sh index 3c2bcb2dbff0..152e8a8eb6cf 100755 --- a/ci/build/npm-postinstall.sh +++ b/ci/build/npm-postinstall.sh @@ -18,7 +18,7 @@ symlink() { dest="$2" rm -rf "$dest" case $OS in - windows) mklink /J "$dest" "$source" ;; + windows) cmd //c mklink //J "$dest" "$source" ;; *) ln -s "$source" "$dest" ;; esac }