Skip to content

Instantly share code, notes, and snippets.

@yuheiy
Created September 5, 2026 11:00
Show Gist options
  • Select an option

  • Save yuheiy/7b4e1f8c1ff774bc47143fd0d8de230e to your computer and use it in GitHub Desktop.

Select an option

Save yuheiy/7b4e1f8c1ff774bc47143fd0d8de230e to your computer and use it in GitHub Desktop.
Minimal reproduction: Knip reports pnpm stage as an unlisted binary

Reproduce Knip's pnpm stage false positive

This reproduction requires Node.js and pnpm. It was verified with Node.js 24.20.0, pnpm 12.3.2, and Knip 6.34.0.

Run these commands in the directory containing package.json:

pnpm install
node node_modules/knip/bin/knip.js --include binaries --no-progress

Knip exits with code 1 and reports:

Unlisted binaries (1)
stage  package.json

Expected: no unlisted binary, because stage is a built-in pnpm command.

Changing the release script to pnpm publish makes the check pass. Adding {"ignoreBinaries":["stage"]} to knip.json also makes it pass.

{
"name": "knip-pnpm-stage-repro",
"private": true,
"scripts": {
"release": "pnpm stage publish"
},
"devDependencies": {
"knip": "6.34.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment