Skip to content

bun x "could not determine executable" when npx does. #9178

Closed as duplicate

Description

@lgarron

What version of Bun is running?

1.0.29

What platform is your computer?

Darwin 23.3.0 arm64 arm

What steps can reproduce the bug?

mkdir /tmp/bunx-repro && cd /tmp/bunx-repro
bun init --yes
bun add @web/[email protected]

# Errors:
bun x @web/test-runner
bunx @web/test-runner

# Runs:
npx @web/test-runner
npm exec @web/test-runner

What is the expected behavior?

bun x is able to run @web/test-runner if node does.

What do you see instead?

error: could not determine executable to run for package @web/test-runner

Additional information

No response

Activity

  1. lgarron commented on Mar 1, 2024

    @lgarron
    ContributorAuthor

    I think the part missing in bun x for feature parity is this:

    If the package has a single entry in its bin field in package.json, or if all entries are aliases of the same command, then that command will be used.

    https://docs.npmjs.com/cli/v8/commands/npx#description

  2. added
    bun installSomething that relates to the npm-compatible client
    on Mar 1, 2024
  3. small-angel commented on Mar 6, 2024

    @small-angel
    Contributor

    Unfortunately, I cannot reproduce this on MacOS arm.

    image

    However I've made some changes in how bunx finds bin files in #9143, so it should be a bit more reliable. When running that branch in a debug build, I still cannot reproduce the results, so that is good.

    I encourage you to try clearing your /tmp folder, or after this pr bun pm cache rm will properly remove bunx caches, though i doubt this is a cache issue as caches auto-clear every day.

  4. lgarron commented on Mar 7, 2024

    @lgarron
    ContributorAuthor

    Thanks, it seems this was a transient issue for me after all!

  5. lgarron commented on Mar 17, 2024

    @lgarron
    ContributorAuthor

    Hmm, unfortunately, I keep running into this. In fact, the original repro occurs with bun 1.0.31.

    Running bun pm cache rm does fix it temporarily, but then the issue returns after a while.

  6. meoyawn commented on Mar 18, 2024

    @meoyawn

    rm -rf ~/.bun/ solves this for me

  7. lgarron commented on Mar 21, 2024

    @lgarron
    ContributorAuthor

    For what it's worth, this is now happening to me regularly.

    I encourage you to try clearing your /tmp folder, or after this pr bun pm cache rm will properly remove bunx caches, though i doubt this is a cache issue as caches auto-clear every day.

    For some reason that doesn't seem to help.

    bun pm cache rm fixes it temporarily, but the issue usually starts reappearing about a day after the previous time I've fixed it. Is it possible the cache is clearing incorrectly and leaving some sort of stale reference in place?

  8. self-assigned this
    on Mar 21, 2024
  9. lgarron commented on Mar 22, 2024

    @lgarron
    ContributorAuthor

    bun pm cache rm fixes it temporarily, but the issue usually starts reappearing about a day after the previous time I've fixed it. Is it possible the cache is clearing incorrectly and leaving some sort of stale reference in place?

    Yeah, I can confirm this keeps breaking roughly once a day.

  10. reopened this on Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingbun installSomething that relates to the npm-compatible client

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions