Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bunx postinstall throws "could not determine executable to run for package exec" #9841

Closed
Lol1chw opened this issue Apr 2, 2024 · 18 comments · Fixed by #17076
Closed

bunx postinstall throws "could not determine executable to run for package exec" #9841

Lol1chw opened this issue Apr 2, 2024 · 18 comments · Fixed by #17076
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client confirmed bug We can reproduce this issue

Comments

@Lol1chw
Copy link

Lol1chw commented Apr 2, 2024

What version of Bun is running?

1.1.0+5903a6141

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

  1. bun create vite
    1. Project Name - reproduce-bun-bug
    2. Select Framework - Vue
    3. Select a variant - Customize with create-vue
    4. Select the options you need
    5. bun install
  2. Following the shadcn-vue installation guide
  3. bunx --bun shadcn-vue@latest init

What is the expected behavior?

Successful launch of cli shadcn-vue

What do you see instead?

$ bunx --bun shadcn-vue@latest init
  ⚙️  vue-demi [1/1] error: could not determine executable to run for package exec      

error: postinstall script from "vue-demi" exited with 1

Additional information

Issue thread in discord

@Lol1chw Lol1chw added the bug Something isn't working label Apr 2, 2024
@Lol1chw
Copy link
Author

Lol1chw commented Apr 3, 2024

UPD: I tried using the full command "bun x" instead of the alias and it worked
bunx_workaround

🚧Workaround:

Use bun x instead of the alias bunx

@Jarred-Sumner
Copy link
Collaborator

Fixed by #9729

@Jarred-Sumner
Copy link
Collaborator

Fixed in #9729, please try again after running bun upgrade --canary in about an hour (or wait for Bun v1.1.1). Let us know if you run into this again.

@bamontales
Copy link

I have experienced this in v1.1.8.

@jdkcoder
Copy link

same as bamontales, experienced this in Bun v1.1.8

@OliverWich
Copy link

Still (or again) present in Bun v1.1.10 (1.1.10+5102a9443)...

image

Curiously, the tip from @Lol1chw of using bun x instead of bunx works. Strange.

@Lucklj521
Copy link

Still present in Bun 1.1.18 and bun x instead of bunx also works.

@Lol1chw
Copy link
Author

Lol1chw commented Jul 4, 2024

Reopen issue because the problem is still unresolved.

@forsureitsme
Copy link

Still present in Bun 1.1.29 and bun x instead of bunx still works.

@dylan-conway dylan-conway reopened this Oct 28, 2024
@hahagu
Copy link

hahagu commented Nov 23, 2024

Can confirm that this is still present in 1.1.36 with shadcn-vue

@RiskyMH RiskyMH added bun install Something that relates to the npm-compatible client confirmed bug We can reproduce this issue labels Dec 16, 2024
@RiskyMH RiskyMH changed the title Windows: bunx postinstall error Windows: bunx postinstall throws "could not determine executable to run for package exec" Dec 16, 2024
@RiskyMH RiskyMH marked this as a duplicate of #9178 Dec 16, 2024
@RiskyMH RiskyMH marked this as a duplicate of #15783 Dec 16, 2024
@RiskyMH RiskyMH marked this as a duplicate of #15562 Dec 16, 2024
@RiskyMH RiskyMH marked this as a duplicate of #14848 Dec 16, 2024
@RiskyMH RiskyMH added windows An issue that is known to occur on Windows and removed windows An issue that is known to occur on Windows labels Dec 16, 2024
@RiskyMH RiskyMH changed the title Windows: bunx postinstall throws "could not determine executable to run for package exec" bunx postinstall throws "could not determine executable to run for package exec" Dec 16, 2024
@RiskyMH RiskyMH marked this as a duplicate of #12330 Dec 16, 2024
@RiskyMH RiskyMH marked this as a duplicate of #12336 Dec 16, 2024
@RiskyMH RiskyMH marked this as a duplicate of #12087 Dec 16, 2024
@RiskyMH RiskyMH marked this as a duplicate of #10068 Dec 16, 2024
@CosmoMyzrailGorynych
Copy link

CosmoMyzrailGorynych commented Dec 21, 2024

Note: bun x versus bunx is most likely a fluke as just running the same bunx command twice can fix installation. For example, this is what happens when I try to install @neutralinojs/cli library. (It uses bufferutil which throws an error when installing)

Also this issue is not exclusive to Windows. (Faced it on Fedora, too)

@Arctomachine
Copy link

Encountered this problem with create-next-app in earlier versions, but not anymore.
In version 1.1.42 it happens for bunx storybook@latest init

bunx storybook@latest init
  ⚙️  esbuild [1/1] error: could not determine executable to run for package exec

error: postinstall script from "esbuild" exited with 1

Contrary to above post, running same command multiple times gives same error, but bun x worked

@RiskyMH
Copy link
Member

RiskyMH commented Feb 5, 2025

I have come to find out some interesting details:

  • bunx my-package works after second attempt (if it was postinstall issue)
  • bunx my-package@tag doesn't work as forces cache clear
  • bunx [email protected] works after second attempt
  • bun x my-package@tag works though (even if bunx didn't), so it must not be force clearing cache
  • for the first one I think it stops working first time occasionally (probably every day) to clear cache to try to be latest

I am feeling like this is possibly a race condition on not letting postinstall finish and go straight to trying to run it.

@RiskyMH
Copy link
Member

RiskyMH commented Feb 5, 2025

Update my initial theory was wrong, it appears like bunx behavior was slightly different in windows and the cli didn't account for this, see my fix in #17076


There is still one issue I haven't worked out: bunx supabase@latest, this works well on linux and npm but:

C:\>bunx supabase@latest
error: could not determine executable to run for package supabase

# installed on local project works though
C:\>bun add supabase
C:\>bunx supabase

I'm not sure the reason behind this, but if you go to the bunx cache folder and run bun i it will also work. So there must be some other issues with postinstall. All my above fix was doing was helping executing the package once it was installed (which explains why second attempt works)

@RiskyMH RiskyMH marked this as not a duplicate of #9178 Feb 5, 2025
@RiskyMH RiskyMH marked this as not a duplicate of #12087 Feb 5, 2025
@RiskyMH
Copy link
Member

RiskyMH commented Feb 5, 2025

@RiskyMH RiskyMH marked this as not a duplicate of #12330 Feb 5, 2025
@MordechaiHadad
Copy link

Have similar issue on latest version on windows (which is what prompted RIsky to comment here)

@RiskyMH
Copy link
Member

RiskyMH commented Feb 5, 2025

If it works with bun x <pkg>, then it will work with my fix of bunx to be equal quality

@Jarred-Sumner Jarred-Sumner marked this as not a duplicate of #15783 Feb 6, 2025
@Jarred-Sumner Jarred-Sumner marked this as not a duplicate of #15562 Feb 6, 2025
@Jarred-Sumner Jarred-Sumner marked this as not a duplicate of #14848 Feb 6, 2025
@Jarred-Sumner Jarred-Sumner marked this as not a duplicate of #12336 Feb 6, 2025
@Jarred-Sumner Jarred-Sumner marked this as not a duplicate of #10068 Feb 6, 2025
@JulianMiguelAngle

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client confirmed bug We can reproduce this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.