Skip to content

bun install and bunx not work well when use husky and @commitlint/cli #10691

Description

@sharh

What version of Bun is running?

1.1.6

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What steps can reproduce the bug?

# bun init
bun init
# install deps
bun install -d @commitlint/config-conventional @commitlint/cli husky
# init git
git init -b dev
# init git hook
bunx husky init

bunx husky init not works well:
image

when change to npx, it works well as the above picture presents.

# huasky init
npx husky init
# commit lint
echo npx --no -- commitlint --edit $1 > .husky/commit-msg
# git commit lint
git commit -am 'test'

while use bun install the deps,the @commitlint/cli not works with husky git hook npx --no -- commitlint --edit $1
image

infact, the command commitlint is installed in node_modules/.bin diretory:
image

when I change the git hook to: bunx --no -- commitlint --edit $1 it works:
image

when use npm install -D @commitlint/config-conventional @commitlint/cli husky,this can be work well:

npx --no -- commitlint --edit $1

image

bunx --no -- commitlint --edit $1

image
both bunx and npx can work well:

What is the expected behavior?

I hope bun install can works well as npm install

bun install -d @commitlint/config-conventional @commitlint/cli husky
bunx husky init
npm install -D @commitlint/config-conventional @commitlint/cli husky
npx husky init

bunx should works well as npx

bunx --no -- commitlint --edit $1 
npx --no -- commitlint --edit $1 

What do you see instead?

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions