lint-staged icon indicating copy to clipboard operation
lint-staged copied to clipboard

Version 16.1.0 seems to fail running "prettier --check"

Open hugovdm opened this issue 5 months ago • 5 comments

The latest release seems to be giving me trouble when trying to run prettier:

$ npx [email protected]
✔ Backed up original state in git stash (d00f8ce)
✔ Running tasks for staged files...
✔ Applying modifications from tasks...
✔ Cleaning up temporary files...

$ npx [email protected]
✔ Backed up original state in git stash (7025c39)
⚠ Running tasks for staged files...
  ❯ lint-staged.config.mjs — 1 file
    ✔ *.{ts,vue,js,jsx} — 1 file
    ❯ * — 1 file
      ✖ prettier --check --ignore-unknown [FAILED]
↓ Skipped because of errors from tasks.
✔ Reverting to original state because of errors...
✔ Cleaning up temporary files...

✖ prettier --check --ignore-unknown failed without output (FAILED).

Here's a short extract from a run with --debug:

[STARTED] prettier --check --ignore-unknown
  lint-staged:getSpawnedTask Failed to kill process with pid "1054109": Error: No matching pid found at /home/hugovdm/git/sterna/functions/node_modules/pidtree/lib/pidtree.js:61:16 at /home/hugovdm/git/sterna/functions/node_modules/pidtree/lib/ps.js:40:7 at ChildProcess.<anonymous> (/home/hugovdm/git/sterna/functions/node_modules/pidtree/lib/bin.js:57:5)     at ChildProcess.emit (node:events:518:28)     at maybeClose (node:internal/child_process:1101:16)     at ChildProcess._handle.onexit (node:internal/child_process:304:5) +126ms
[FAILED] prettier --check --ignore-unknown [FAILED]
[FAILED] prettier --check --ignore-unknown [FAILED]
[COMPLETED] Running tasks for staged files...
[STARTED] Applying modifications from tasks...
[SKIPPED] Skipped because of errors from tasks.
[STARTED] Reverting to original state because of errors...

In the process of trying to debug this, I tried different prettier command-lines. I know prettier --version succeeds, at least, whereas prettier --write also fails.

hugovdm avatar May 28 '25 19:05 hugovdm