-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
bun update does not update package.json #5856
Comments
+1 for this task. I am using bun in production already, just had to manually check the package.json for outdated lines, even though the modules are acutally updated by bun |
any ETA for the fix? |
I have this issue as well. |
1+ priority pls. |
+1 priority |
1 similar comment
+1 priority |
Also agree on priority, really stopping me from moving to bun on some projects |
But is this wanted behaviour ? Package.json has the version constraints , and an update will update them within those constraints. With npm, the only thing that's changing is the lock file. I don't get what should change in the package.json when running bun update? |
If you've used |
Have the same issue. We need a command for updating versions in package.json too |
Sounds confusing, and kinda defeating of the whole "version constraints and lockfile" idea. I'm sure it has its place, not arguing against that. Just surprised. It's not what almost every other package manager does, in JS or other languages. "Install" follows the lockfile if available, or creates/amends it. Ignoring the version constraints in package.json is not what npm does, pnpm does and in other languages. And sounds confusion , why else are the constraints there? I must be missing something. If you dont want version constraints and want to take new major versions or whatever, just name them "*" or something in package.json? |
It’s not confusing. People want to see what version of the package they are on without sieving through the lockfiles. It also makes it a lot easier to freeze the dependency when we eventually hit an issue with the latest version. Btw |
So, I'm reading if yarn really does something different to other package managers. So, hear me out. There is a reason - I think - that yarn didn't choose the same I'm not saying that the functionality you people want shouldn't exist. Not at all. But - the pnpm command above is a good example - it should be a flag or a different command, not just 'update'. Because there is a different expectation compared to saying 'bun update'. If you name the command the same as The package-manager of course doesn't have to be an exact clone from the npm functionality, that is for the bun people to decide. This might be of course my bubble, but I would not expect bun - or any other package manager - to adjust the main JSON package file from running So… in my humble opinion, just from the convention set for tools like npm, pnpm, composer and probably others… the
The description for From what's currently in the So. there is some information in the bun help output that contradicts the current behaviour. So I guess it's up to the bun team to decide what they actually want the command to do, and then fix the But I know a lot of people will be scratching their heads when |
I agree that it should be a flag like |
1+ priority pls. |
this project should never had released a |
The team has a different road map compared to what you find important. It
happens . Jared already mentioned he thinks this is important, they just
have different things to do first, for whatever reason. Accept that, please
.
And like is mentioned here (by me? Maybe others ) is that updating the
version constraints file while doing update isn't standard at all .
…On Sun, Jan 28, 2024, 17:40 sebolio ***@***.***> wrote:
this project should never had released a 1.0 version, it totally lacks of
real-world testing, i see a lot of issues in github from people who can't
achieve basic Node/npm/pnpm things and, just like this one, are completely
ignored even after 4 months
—
Reply to this email directly, view it on GitHub
<#5856 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALMD2DRRAD3PY33PZKUDTGDYQZ5PVAVCNFSM6AAAAAA5BJIMLKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJTGY2TKMZWGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Any update? |
then add an "upgrade" command like other managers do? come on, it's been 6 months |
This is such an essential tooling feature. Let's prioritize this a bit higher, please? |
Still exists on 1.0.33. |
We will fix this a little bit after v1.1. The team is focused on shipping Windows support right now, and we're so close. |
Good job! |
+1 priority |
+1 priority |
+1 on this |
+1 priority |
+1 |
For a workaround, |
Thx for the workaround! |
@tobycm wow, are there any docs I could read about this command? |
@tobycm nevermind, I found it's an NPM package: https://www.npmjs.com/package/taze There's also https://www.npmjs.com/package/npm-check-updates which says it's bun compatible, so you can simply |
I just wanted to also +1 this. We are using |
please fix this |
This issue still exists in version |
yes, it still exists, and now it is not even updating dependencies let alone updating the package.json. Just updated to 1.1.3 |
As of
None of these commands update |
The issue still persists in version 1.1.4 of Bun. It has been a considerable amount of time, and the inconvenience of manually writing the package.json file is quite frustrating. |
For now you can use bunx taze |
I agree it's annoying there's no response after calling Struggling to build a Docker image with Bun too. |
This will be fixed in Bun v1.1.11 (#11340) |
Thank you so much for making it save changes by default! That's the right call, Bun shouldn't just follow in the footsteps of what other package managers have done. |
I'm sorry, but this makes no sense to me. Composer does not edit your Your "json" file should be for defining what version constraints you want, and your lock file should be for defining what version you have. Changes to the "json" file should be made when you explicitly want to change the constraints, not to sync them up with your lock file on every update. While it probably won't negatively impact a majority of apps, IMO it just creates a lot of unnecessary Git changes. If people truly need this feature, I would argue that it should be behind a feature flag, and the default should be to not edit the For context, I am a PHP developer that uses |
@browner12, i would argue that |
correct, your lock file (
This is how both NPM and Composer have behaved for years. |
@browner12 in your opinion, what are the benefits of the behavior you explained? And if I want to update my packages, what are the disadvantages of updating both the package.json and the lock file? |
@browner12 that's what
This is a logical fallacy. |
The problem here is that IF YOU ARE USING RANGES in your pachage.json deps, then you can end up in a scenario where you can't be certain of the specific version you have. Imagine you need to downgrade due to a security issue or a bug, how would you know what version you actually have? Looking into the lock file For example: "dependencies": {
"express": "5.0.0-beta.3",
}, Instead of: "dependencies": {
"express": "^5",
}, When updating a package, you should explicitly mention the dep version. Then Bun will update the package.json (by default it uses --save now), and you have total clarity on what version you have. |
@malininss I would say there are two disadvantages to having
I point to Composer and NPM not to simply follow what came before us, but to lay precedent from 2 wildly successful projects where the behavior I've discussed is preferred. @sindelio by specifying an exact version you've now effectively just neutered your package manager, and have to do all version management yourself. Half of the point of dependency management is to use ranges and semantic versioning to get non breaking package updates. NPM had a command called |
@browner12, i don't see the point. As mentioned prior, what you want is already done by Lastly, why does this command even exist? Bun tries to solve the problems node developers have always have and tries to package the solution with bun so that you dont need any additional dependencies for that. Without the existance of an update command, the only way to update packages would be updating version numbers by hand one by one or installing a dependency that does that for you. Both ways, it is your intention to update In the end, I would say that I find no good reason to believe that the current default behaviour of the update command should be changed. |
@browner12 I use the package manager to download and deps, allocate their code neatly and deduplicate code if needed. Updating a package is very deliberate to me, because it can break a project in many ways. So I don't want a command that leaves me with doubt on the version of a dep in the project. For instance, every time the deps are updated, I run tests against them to make sure everything is running. |
What version of Bun is running?
1.0.2
What platform is your computer?
Darwin 22.6.0 arm64 arm
What steps can reproduce the bug?
run
bun update
in any node project with bun as a package managerWhat is the expected behavior?
when we run
bun update
, it should update all the dependencies in the package.json.What do you see instead?
when we run
bun update
, it shows updated dependencies in the terminal and indentation of package.json changes without change to the dependency versionAdditional information
No response
The text was updated successfully, but these errors were encountered: