Bug
A fresh Windows install can fail during the root postinstall script because the script ends with a Unix-only fallback:
"postinstall": "pnpm dlx @socketsecurity/socket-patch apply --silent --ecosystems npm && git rev-parse --is-inside-work-tree > /dev/null 2>&1 && git config core.hooksPath hooks || true"
On Windows, when the preceding command path reaches the fallback, cmd.exe tries to execute true and fails with:
'true' is not recognized as an internal or external command,
operable program or batch file.
Reproduction
From a normal Windows checkout:
That triggers dependency installation, then the postinstall chain fails at the shell fallback.
Expected
The postinstall should be cross-platform. Socket patching and Git hook setup are best-effort setup tasks, so a missing/free Socket patch token or non-git environment should not make a Windows install fail.
Fix direction
Move the postinstall logic into a tiny Node script that runs the same best-effort setup without relying on Unix shell syntax.
Bug
A fresh Windows install can fail during the root
postinstallscript because the script ends with a Unix-only fallback:On Windows, when the preceding command path reaches the fallback,
cmd.exetries to executetrueand fails with:Reproduction
From a normal Windows checkout:
That triggers dependency installation, then the postinstall chain fails at the shell fallback.
Expected
The postinstall should be cross-platform. Socket patching and Git hook setup are best-effort setup tasks, so a missing/free Socket patch token or non-git environment should not make a Windows install fail.
Fix direction
Move the postinstall logic into a tiny Node script that runs the same best-effort setup without relying on Unix shell syntax.