Skip to content

publish:check crashes on Windows (spawns pnpm without a shell; tar reads C: as a host) #367

Closed

Description

@stackbilt-admin

Found while cutting 2.0.0.

pnpm run publish:check (scripts/assert-packages-publishable.mjs) crashes on Windows before checking anything:

TypeError: Cannot read properties of undefined (reading 'trim')
    at run (scripts/assert-packages-publishable.mjs:52)

run() calls spawnSync("pnpm", …) without shell: true. On Windows, pnpm is pnpm.cmd, so the process never starts: result.status is null, result.stdout is undefined, and the error path itself throws. The tar calls have a second Windows problem: GNU tar under Git Bash reads C:/… tarball paths as a remote host unless --force-local is passed.

CI is unaffected, because the release workflow runs on Linux. But a maintainer can't run the pre-publish check locally on Windows. For 2.0.0 the two checks were run by hand: no workspace: specifiers, and no test artifacts in any tarball.

Fix:

  • spawn pnpm through the shell on win32 (or resolve pnpm.cmd);
  • report result.error when the spawn fails, instead of dereferencing stdout;
  • pass --force-local to tar on win32, or read the tarballs with a node tar library.
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions