Skip to content

npm install fails: postinstall runs bunx git-hooks (no executable in git-hooks package) #1543

@jssblck

Description

@jssblck

Summary

npm install fails for @stacksjs/clapp because the published package runs this postinstall script:

bunx git-hooks

That command fails with:

error: could not determine executable to run for package git-hooks

Reproduction

npm install -g @stacksjs/clapp

Actual result

Install exits with code 1:

npm ERR! code 1
npm ERR! path .../node_modules/@stacksjs/clapp
npm ERR! command failed
npm ERR! command sh -c bunx git-hooks
npm ERR! error: could not determine executable to run for package git-hooks

Expected result

Package installs successfully with npm.

Why this happens

The npm package named git-hooks does not expose an executable. The executable git-hooks is provided by bun-git-hooks.

So bunx git-hooks appears to resolve the wrong package name in postinstall.

Impact

This also breaks transitive installs for packages that depend on @stacksjs/clapp (for example via bunfig), so unrelated installs fail.

Suggested fixes

  1. Remove dev-only git hook setup from published package postinstall, or guard it so it only runs in the source repo.
  2. If postinstall must remain, use the correct package/binary (for example bunx bun-git-hooks) and ensure it does not fail consumer installs.

Environment

  • macOS 15.3 (Darwin 25.3.0)
  • Node v22.18.0
  • npm 10.9.3
  • Bun present on PATH

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