Skip to content

postinstall fails on Windows because Unix true is not available #261

@adliebe

Description

@adliebe

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:

pnpm exec eslint .

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions