theam / theam/facility

fix(scripts): pnpm verify cannot run on Windows — spawnSync pnpm ENOENT

Open Beginner friendly
#372 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
71
Forks
64
Avg merge
15h 38m
Merged PRs (30d)
66

Description

What happened

Related to #182 and PR #184, but a different script and a different error.
#182 covers pnpm dev (EINVAL in scripts/dev.mjs). PR #184 changes only
dev.mjs and dev.test.mjs, so pnpm verify stays broken after it lands.
PR #173, the other Windows pass, doesn't touch verify.mjs either.

scripts/verify.mjs spawns every step as "pnpm" with no Windows variant
and no shell (lines 20-44, run helpers at 57 and 67). Windows resolves only
.com and .exe as executables, so pnpm — which exists as pnpm.cmd — is
never found, and the run dies with ENOENT on the first step (Lint).

dev.mjs at least attempts Windows on line 10; verify.mjs does not.

This is the one that blocks contributing rather than convenience.
pnpm verify is the acceptance command named in CONTRIBUTING.md and it is
the first checkbox in the pull request template. A contributor on Windows
cannot run the gate the project requires — including anyone trying to
validate a fix for #182.

How to reproduce

Windows 11, PowerShell, Node 24.19.0, pnpm 11.20.0 installed via the
documented corepack install --global pnpm@11.20.0.

pnpm verify -> spawnSync pnpm ENOENT on the Lint step

Minimal confirmation, repository out of the picture:

PS C:> where.exe pnpm
C:\Program Files\nodejs\pnpm
C:\Program Files\nodejs\pnpm.CMD

spawnSync('pnpm', ['-v']) -> ENOENT
spawnSync('pnpm.cmd', ['-v']) -> EINVAL
spawnSync('pnpm', ['-v'], {shell:true}) -> 11.20.0

The extensionless pnpm is a POSIX shell script for Git Bash, which
Windows cannot execute directly.

Note for whoever fixes it: Node emits DEP0190 against shell: true with
separate args. Safe for the current literal arguments, but a deprecated
pattern to build on.

How are you running Facility?

Local development (pnpm dev)

Version

771b647

Evidence
PS C:\dev\facility> pnpm verify
$ node scripts/verify.mjs

==> Lint
Error: spawnSync pnpm ENOENT
    at run (file:///C:/dev/facility/scripts/verify.mjs:67:18)
    at step (file:///C:/dev/facility/scripts/verify.mjs:53:3)
    at file:///C:/dev/facility/scripts/verify.mjs:20:3
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawnSync pnpm',
  path: 'pnpm',
  spawnargs: [ 'lint' ]

Node.js v24.19.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read scripts/verify.mjs at lines 20-44 and the run helpers around lines 57 and 67, then compare the Windows handling in dev.mjs line 10. Reproduce the failure with pnpm verify on Windows and confirm the verification gate completes successfully there without breaking the existing lint and other steps.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.