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 Doesn't Update Package.json #3266
Comments
The documented behavior of
So running a
|
@rally25rs you are right @bestander we should close this. |
For a decent workaround, see #2042 (comment) |
For those of you like myself who were confused by @rally25rs comment:
There's a small typo on the first command, it's Otherwise, I can confirm that it works as expected! |
oops, sorry for the confusion. NPM and Bower both have an |
|
@MrHubble from the docs for upgrade
The same is true for Not updating the package.json file is the as-designed behavior since there is nothing to update. The version upgraded to will match the semver range specified in package.json. Adding the Hope that makes sense. There was a discussion thread in an issue somewhere about a feature request to still update package.json to whatever new version is installed no matter what, but that has not been implemented yet. |
I want to update a package from 1.0.10 to last version (1.0.13). I guess I'm still going with this dirty workaround: delete line in package.json and |
what does `yarn add mypackage@1.0.13` say?
…On 8 November 2017 at 09:58, Maxime Vasse ***@***.***> wrote:
I want to update a package from 1.0.10 to last version (1.0.13).
yarn upgrade mypackage does not update my package.json.
I guess I'm still going with this dirty workaround: delete line in
package.json and yarn add ¯\_(ツ)_/¯
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#3266 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACBdWKTYVK64ZDcH2xqQ-QQwImEcw_cCks5s0evEgaJpZM4NJvLj>
.
|
This works! Still don't know why |
@webdif |
If I run |
best solution |
This helped me: https://www.npmjs.com/package/syncyarnlock
|
This is a modified version of @harlantwood 's comment here using npx npm-check-updates --upgrade --upgradeAll && yarn upgrade |
I do following to update package.json:
|
If this is still giving anyone troubles the comment from homerjam and cpxPratik made reference to this: https://www.npmjs.com/package/syncyarnlock It solved the issue for me in ten minutes. |
hey *nix guys, what about this:
|
Just using " yarn upgrade-interactive " works for me! yarn vesion: 1.7.0 |
Using |
I can't understand what upgrade command do, |
@felipe-coelho you could also use the Without |
I found a solution. At first I tried all the possible combinations of yarn upgrade without any results. Notice the package version is prefixed with '^' (example: "@angular/material": "^8.1.1"), meaning only minor version upgrades will be applied. I changed the packages from prefix '^' to '*' (example: "@angular/material": "*8.1.1"), and then after running the yarn command: yarn install is required after modifying the package.json. The lock file needs to be updated by running the command -> yarn install The result was the packages upgraded to the latest version at the time -> "@angular/material": "8.2.3". I hope this helps. |
@rubensurf - When you have a large monorepo (e.g. Lerna), you absolutely do not want to go that route. If you have multiple dependencies, several of which have MAJOR version changes, you can end up spending a LOT of time tracking down root breaking changes that have broken your app (i.e. things in your app that broke because a dependency had a MAJOR version change). My workflow is to regularly run The only problem is that |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
yarn upgrade
doesn't update package.json unless you go package by packageyarn upgrade @angular
, and usingyarn upgrade-interactive
puts a lot of responsibility on knowing exactly what package depend on what as our team found out when the version of codelyzer, tslint, zone.js, and typescript were updated beyond what Angular and Angular CLI required.What is the expected behavior?
Package.json would have the version changes added.
Please mention your node.js, yarn and operating system version.
Yarn v0.22.0
Windows 10
Node 7.7.2
The text was updated successfully, but these errors were encountered: