Skip to content

Run the link-check bin directly, not via npx#480

Merged
chalin merged 1 commit into
google:mainfrom
chalin:chalin-drop-npx-from-link-scripts-2026-0722
Jul 22, 2026
Merged

Run the link-check bin directly, not via npx#480
chalin merged 1 commit into
google:mainfrom
chalin:chalin-drop-npx-from-link-scripts-2026-0722

Conversation

@chalin

@chalin chalin commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator
  • Drops npx from the _check:links script: npm run already puts node_modules/.bin on the PATH, so the bin provided by the link-cache devDependency resolves directly.
  • Rationale: npx BIN silently falls back to the public npm registry when node_modules is stale or missing, executing whatever package claims that name there; a bare bin name instead fails loudly (exit 127) with zero registry traffic.
  • Verified: the script resolves the local bin; with the devDependency removed from node_modules, it exits 127 with no network access.

- Drops `npx` from the `_check:links` script: the bin comes from the git-only `link-cache` devDependency, so it is never fetchable from the npm registry by that name.
- With `npx`, a stale or missing `node_modules` silently falls back to the public registry, executing whatever package holds the name there. The bare bin name resolves via `node_modules/.bin` (on the PATH under `npm run`) and fails loudly (exit 127, no network) when the install is missing.
@chalin
chalin merged commit 18f7d7a into google:main Jul 22, 2026
12 checks passed
@chalin
chalin deleted the chalin-drop-npx-from-link-scripts-2026-0722 branch July 22, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant