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 properly update package.json
for dev dependencies
#1458
Comments
I can confirm that I am seeing this happen on the exact same version of Yarn. Instead of updating the existing development dependency, it adds a new entry to "dependencies" and leaves the existing development dependency there. |
Confirmed bug here as well. |
Same here. I've tried both Lovely program though! Thank you for building it! |
Here is the same issue, a bit before - #1262 |
Same here. |
Same here. Every module updated via IMO update should either accept the same opts as
|
#1620 fixes this so I'm going to close this and move discussion there. |
Still not fixed, I'm using latest Yarn installed via Homebrew. |
@kube Could you please add more details if it is still an issue? Versions for OS, Node, Yarn? A |
I'm on macOS 10.12.1, installed Yarn with Homebrew. And here is the
|
@kube Please try on |
Sure, but Homebrew still has 0.16.1
Tried installing with NPM and just had the latest version, but seems strange to install Yarn with NPM. |
Ok everything works fine when using 0.17.0, but maybe you should update Brew version. |
Brew is the preferred method of installation for OSX. It is still a manual process for getting it updated on Homebrew, so someone will have to request it being updated like they did here: Homebrew/homebrew-core#6060 |
When I run I'm using yarn 0.17.2 from homebrew. |
@milesj, this should probably be a separate issue and please provide steps to reproduce along with a |
I'll create a new issue. |
On Debian Stable, yarn 0.17.4, this issue seems to be fixed at least. It upgraded |
I'm trying to upgrade grunt-sass from I also tried |
Using yarn v0.18.1 I'm still unable to force an upgrade of a sub-dependency. |
@iamfreee Nope, you've gotta do |
I posted a new issue detailing all this, see here #3492 and perhaps continue the discussion there. |
I would also like to echo that I've had success with |
~> yarn -v
1.0.0
~> yarn upgrade --help | grep "\-\-latest" | head -n 1
--latest list the latest version of packages, ignoring version ranges in package.json |
|
@milesj Can you try the nightly builds? https://yarnpkg.com/en/docs/nightly This PR may have fixed it da2b909 |
@kaylieEB I am not certain but I think
|
@lehni There's also |
@milesj : did you mean |
Err yeah, brain fart. Thanks. |
same here with yarn 1.3.2 |
same here with yarn 1.5.1 |
Broken in 1.5.1 again |
broken with -
|
same issue node v8.9.4 |
One workaround: use In short:
However npm update's doc says:
But in fact...
Don't know which one to use :( Yarn added this behavior sometime in 2017 and then broke it silently. npm claims to have it when it doesn't work either. @kittens Please reopen this issue. |
as said by @octref
Editread #5602 (comment) |
Works like a charm. Need to update these two Docs pages to use |
I've been using |
Seems a bit redundant.. Why not just use the easiest of all of these commands, |
@guylepage3 because I get to see what upgrades are available in what versions with different color coding based on patch / minor / major version changes, pick the ones I want to upgrade, and perform multiple upgrades at once that way. Nothing redundant about that? |
@lehni then the documentation on the website should reflect this and the following two pages should state to use the |
@guylepage3 this conversation is leading nowhere nor does it help. If you want to suggest update of docs, it might be better to create new issue specifically for that. |
Sorry if you feel that way @alexdevero. And yep already did if you look above.. #1458 (reference) |
This helped me: https://www.npmjs.com/package/syncyarnlock
|
This does not work for me for yarn workspaces. Can someone take a look? |
@igbopie perhaps this should be raised as a separate issue since this issue is closed? |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
Running
yarn upgrade
to upgrade a dev dependency, even with the--dev
flag, will add the upgraded version of the dependency to thedependencies
hash inpackage.json
rather thandevDependencies
.This might also be an issue with other dependency types (like peer), but I have not tested.
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
yarn upgrade
should update the version string of the entry in thedevDependencies
hash.It would be nice if this could be done without
--dev
using the current location of the dependency (upgrading a dev dep would modifydevDependencies
, upgrading a normal dep would modifydependencies
).Please mention your node.js, yarn and operating system version.
The text was updated successfully, but these errors were encountered: