Skip to content

Bug: postinstall script fails on Windows #610

Description

@chrille0313

Current status

Verified against main on 2026-08-28: pkgs/cli/package.json still contains the failing postinstall script. PR #612 has the correct minimal removal, but it is based on v0.13.3 and needs a current patch changeset and full CI before merge. Refresh or recreate that PR rather than redesigning the fix.

Description

The pgflow package's postinstall script fails on Windows, preventing installation via npm install pgflow or npx pgflow@latest install.

Steps to reproduce

  1. On Windows (PowerShell or cmd), run: npx pgflow@latest install
  2. Or: npm install -g pgflow@latest

Expected behavior

Installation completes successfully.

Actual behavior

Installation fails with:

npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c chmod +x dist/index.js || true
npm error 'chmod' is not recognized as an internal or external command,
npm error operable program or batch file.
npm error 'true' is not recognized as an internal or external command,
npm error operable program or batch file.

Root cause

The postinstall script runs chmod +x dist/index.js || true — Unix commands that don't exist on Windows.

Workaround

Install with scripts disabled, then run the CLI:

npm install pgflow@latest --ignore-scripts
npx pgflow install

Environment

  • OS: Windows 10/11
  • Node: v24.12.0 (also reproducible on other versions)
  • npm: latest

0.15.1 release verification

This fix is part of the release tracked by #666. Add a patch changeset and one small permanent windows-latest package smoke workflow rather than a full Windows CI matrix.

The Windows job must:

  1. build the CLI;
  2. create its publishable tarball with pnpm pack;
  3. install the tarball into a clean directory with lifecycle scripts enabled;
  4. run the npm-created pgflow.cmd --version shim.

The job needs no Supabase, Docker, Atlas, or full CLI E2E suite. Current CI runs only on Ubuntu and invokes node dist/index.js directly, so it does not test npm installation or Windows shims.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpkgs/clipriority:p1Next batch: current correctness, user blocker, or operational safety

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions