You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With outdated packages present, yarn outdated exits with 1
What is the expected behavior?
In my opinion, this feature is essentially useful to know that new versions of libraries are available.
If you rely on a framework or some other libraries you can't always have up to date library to their latest version, or you may have no time to upgrade them (in case of breaking changes by example).
That's perfectly normal in a production environment with various release lifecycles to do that.
But with this non-zero exit code, it breaks any automated build or CI system which rely on this exit code to know if the operation failed or not (in my case Maven and Jenkins).
Having outdated libraries IS NOT a failure, it's only an information.
I can understand that "yarn audit" command return non-zero status code because it's about security but not this one.
Saying that, I think that this command should at least provide an option to determine if outdated should return zero or non-zero exit code in case of presence of outdated libraries.
If you agreed with that statement or have any better solution I can found time to implement it and send a pull request.
Well, I created the #3483 because in some cases it makes sense to treat yarn outdated as critical check. But I do agree that it's not always the case. 👍
From my perspective, either flag to exit with 0 when there are outdated packages or a flag to exit with 1 in that case would solve the problem.
I personally would prefer having to specify an extra flag to show that I want to treat outdated packages as normal situation, in part because then the default behavior lines up with how npm outdated behaves. But that's my personal preference, and as long as there is a way to say "please exit with non-zero status code when there are outdated packages" I don't really care that much what is default behaviour.
Nice !
I think we shouldn't change the current behavior and have an extra flag to tread oudated package as a normal situation.
I'll make a PR in a few days in this this direction with the flag "--no-error-on-outdated"
I'm not sure if this flag label is good, tell me if you have any better naming.
I'll do the same for npm to keep consistency for this function on both tools.
Do you want to request a feature or report a bug?
Feature.
What is the current behavior?
With outdated packages present, yarn outdated exits with 1
What is the expected behavior?
In my opinion, this feature is essentially useful to know that new versions of libraries are available.
If you rely on a framework or some other libraries you can't always have up to date library to their latest version, or you may have no time to upgrade them (in case of breaking changes by example).
That's perfectly normal in a production environment with various release lifecycles to do that.
But with this non-zero exit code, it breaks any automated build or CI system which rely on this exit code to know if the operation failed or not (in my case Maven and Jenkins).
Having outdated libraries IS NOT a failure, it's only an information.
I can understand that "yarn audit" command return non-zero status code because it's about security but not this one.
Saying that, I think that this command should at least provide an option to determine if outdated should return zero or non-zero exit code in case of presence of outdated libraries.
If you agreed with that statement or have any better solution I can found time to implement it and send a pull request.
#3483 (comment)
I also create a bug for npm because as far as I have found the --silent flag should exactly do what I want but it's not working:
https://npm.community/t/npm-outdated-should-have-an-option-to-have-non-zero-exit-code/10239
Please mention your node.js, yarn and operating system version.
OS: Ubuntu 18.04
Node: v11.6.0
Yarn: 1.18.0
The text was updated successfully, but these errors were encountered: