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
yarn upgrade
does not update package.json
#2042
Comments
As I understand the docs, the |
I could of sworn that My other issue with upgrading a package directly, is that it updates the version without the |
It could be a bug. I don't think it's necessary to update |
I also want a way to update my version numbers in As a workaround, I am currently doing:
The last line I alias to |
Maybe a strange question, but is it actually necessary to update the Thx in advance |
@goemaeret While that is correct, I'm just not a fan of adding a version to package.json once and forgetting it forever. I'd rather the lock file and package.json be incremented together. Just seems odd that the version in the package.json could theoretically be a year old and like 30 versions behind. Furthermore, it's the more human readable version compared to the lock file. |
@milesj some very clever arguments you pointed out there. Thx a lot! |
|
This would be useful to have the package.json file have the up-to-date version numbers so you can see at a glance the version numbers you have |
Interestingly, |
Where is |
Only in #2891 is meaning features are frequently being added without their equivalent docs changes. |
@bestander we can close this O.o |
@voxsim @bestander Why was it closed? Because of |
I also wanted |
This is currently happening to me now after installing yarn v1.0.1. It updates my yarn.lock file, but not package.json. macOS v10.12.6 |
This needs to be reopened. I'm currently experiencing the same behaviour with v1.0.1. Either it's a bug, or the documentation is incorrect. |
This needs to be reopened +1 |
Instead of reopening, we may file a new issue. We had a similar report at #4390. |
Is this just expected behavior? Am I missing something? |
check but use with caution as it will not respect semver. It will just update to the latest tag |
I was having the same problem. As others were suggesting running: $ yarn upgrade webpack webpack-dev-server or-any-other-library --latest updated only the packages listed to the latest version (as expected) and also updated both |
@AmyShieh yes, I am using |
The only way I managed to upgrade ALL my packages to latest was to manually run
I would expect those to bulk update everything in |
yarn upgrade --latest Does not update package.json |
|
I seem to need the opposite behavior everyone else is asking for.. possibly someone can open my eyes to something I am missing? Scenario: We have a codebase that requires Now, last time the This is where my issue arises: It seems that every command yarn offers also updates the Question: Is there really no way to tell yarn to update my lockfile according to my |
This bug is still not solved.
with yarn 1.12.3 - package gets not updated |
Also was struggling with the same problem. ATTENTION!!! THIS WILL WIPE YOUR WORK COMPLETELY. COMMIT ALL UNSAVED CHANGES YOU NEED! git reset --hard
git clean -dxf It might be cleaning all the crap might help. Then I started git reset --hard
git clean -dxf
yarn upgrade fable-compiler --latest
yarn upgrade fable-loader --latest and I have in both files both dependencies updated. |
What is the status of this issue? |
|
➡️ And now you run the same but with ➡️ It solves. |
The issue still persists. My package.json is sometimes over 10 versions out of date compared to yarn.lock *is this a feature? |
I have yarn v. 1.12.3
If I change depA version manually to 0.13.0, execute steps 2 and 3, then I will get depA v. 0.13.0 into yarn's cache. After that I can go into package.json, change back the depA version to 0.11.0 and execute steps 2 and 3 again. This time package.json gets the version upgraded. My conclusion: during yarn upgrade --latest (in case of semver) yarn looks for latest version inside the cache and loads from remote only if no corresponding package (as stated by semver) found. PS: after updating yarn to v. 1.16.0 issue above disappeared. |
Looks like it's still an issue. Only thing that worked for me was |
Just having this issue. |
On yarn version |
This worked for me: yarn global add npm-check-updates
ncu -u got this list in the terminal: Used yarn install with the --check-files flag: yarn install --check-files
ncu -u Also if you want to upgrade only one package and have it reflect in the yarn add lodash@latest
or
yarn add lodash@<version> Time to dance! :) |
I am having this issue in yarn 1.22.4 |
I switched to the |
its been 4 years & I am still facing this issue.
does not update / upgrade node: v14.16.0 |
This needs to be reopened +1 |
Gives you a list of versions to pick from, and updates package.json afterwards, |
What to do If we have more than 30-50+ packages? |
Does not update package.json in monorepo.
Tries to install old dependency and crashes (new versions not crashing) |
Amazed nobody has mentioned Upgrade all packages (respecting semver) and update package.json:
|
It works only for yarn version 1.2.x but not the later versions of yarn (example: yarn 3.x.x or 4.x.x) |
Do you want to request a feature or report a bug?
Bug (or maybe request)?
What is the current behavior?
Running
yarn upgrade
will update dependencies, but not update the versions inpackage.json
.If the current behavior is a bug, please provide the steps to reproduce.
Here's an output of my console logs.
What is the expected behavior?
The
package.json
versions are updated (including the^
caret).Please mention your node.js, yarn and operating system version.
Yarn v0.17.8
Node.js v7.2.0
macOS v10.12.1
More information.
In my projects, I would constantly use
npm update --save-dev
to update dev dependencies and thepackage.json
with the latest versions. This allows my dev tooling to always stay constant.However, I would not do the same for non-dev dependencies, as those should be locked into a specific version as to not restrict consumers. For example, supporting React
^15.0.0
instead of^15.4.1
.The text was updated successfully, but these errors were encountered: