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 bug: @latest doesn't pull latest from registry #4989

Closed
juliusmarminge opened this issue Sep 11, 2023 · 6 comments
Closed

bunx bug: @latest doesn't pull latest from registry #4989

juliusmarminge opened this issue Sep 11, 2023 · 6 comments
Labels
bug Something isn't working npm Something that relates to the npm-compatible client

Comments

@juliusmarminge
Copy link

juliusmarminge commented Sep 11, 2023

What version of Bun is running?

1.0.0

What platform is your computer?

Darwin 22.5.0 arm64 arm

What steps can reproduce the bug?

I'm not sure if this is easily reproducable since it's dependant on what package version you have installed locally, but for me I ran bunx create-t3-app and got 7.19, appending @latest didn't seem to make a difference which it does for at least npm and pnpm (it forces a pull from registry instead of using local version)

CleanShot 2023-09-11 at 20 52 00@2x

What is the expected behavior?

Appending @latest to the package name should force bun to pull latest from registry

bunx create-t3-app@latest should retrieve 7.20.0 instead of 7.19.0 (I'm guessing it will for everyone after a while???, but @latest should force it)

What do you see instead?

I got an old version of the executable. Not even after i ran 7.20.0 explicitely does it use that for future runs

Additional information

No response

@juliusmarminge juliusmarminge added the bug Something isn't working label Sep 11, 2023
@Jarred-Sumner
Copy link
Collaborator

Jarred-Sumner commented Sep 11, 2023

Yeah, we need to fix this.

bunx uses the cached version if it exists locally and clears only when /tmp is cleared. It needs to not do that when a tag is used (bun create uses bunx)

@Jarred-Sumner Jarred-Sumner changed the title bug: @latest doesn't pull latest from registry bunx bug: @latest doesn't pull latest from registry Sep 11, 2023
@Electroid Electroid added the npm Something that relates to the npm-compatible client label Sep 11, 2023
@azu
Copy link

azu commented Sep 12, 2023

Duplicate of

@juliusmarminge
Copy link
Author

Fixed in #5346. Thanks 🙏

@Electroid
Copy link
Contributor

According to #6741, this may have not been fully fixed.

@nateemerson
Copy link

nateemerson commented Nov 5, 2023

I also hit this issue this morning. Here's my personal repro story over the last few days:

  1. Last week, I installed create-t3-app@latest using bun v1.0.1 which installed+cached ct3a v7.22.0.
  2. This morning I reran to see if there was an update and bun create t3-app@latest gave me the "You are using an outdated version of create-t3-app" message (7.23.1 available). This was a standard repro of this issue, before I updated and got the fix
  3. I upgraded bun from v1.0.1 to v1.0.9
  4. Repeated step 2 with same results This is a supposed repro of this issue, post fix (assuming this fix made it into 1.0.9)

Hypothesis: The fact that ct3a@latest was cached using the earlier version of bun meant the fix wouldn't impact me

In the screenshot you can see me confirm that the cache directory in /tmp is still being created post-upgrade, but Idk if there's something different about the cached directory after the update that may fix.

In theory, had I installed ct3a v7.22.0 initially with bun v1.0.9, then run the @latest install again after v7.23.1 release, perhaps it would bump the version, but idk the best way to mock a version bump for the package I'm installing from @latest

Note: I was using bun create t3-app instead of bunx but I believe those are the same thing...
image

@paperdave
Copy link
Collaborator

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

No branches or pull requests

6 participants