-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Don't warn about incompatible optional dependencies #3738
Comments
Seems like an appropriate use of warn to me. |
Wouldn't it be better to fix the thing that is giving the warning instead of just hiding it? |
What do you mean by "fix"? As explained in npm/npm#11632, everything is working as intended. Some packages depend on |
I would say that requiring a dependency and adding binaries for a specific OS should not be how it works. |
If you have an alternative suggestion about what packages using |
Looks like opinions are split. |
@gaearon given this is an open source repo, how about a PR to add a CLI flag to suppress by log level. It would be very incorrect to paper over a downstream issue in the packages you're referencing whether it be a superior computer or just a $35 RPi which can do most of the same stuff. |
I would have loved to send a PR but, like @bestander, I also work full time on maintaining other open source projects, and unfortunately don’t have the time to work on this particular feature. I raised an issue to discuss whether it is desirable or not.
I don’t understand this comment. I am not suggesting to “paper over a downstream issue”. Everything already works as intended, except that both npm and yarn also print a message that looks scary but doesn’t actually indicate a problem. But there is no reason for the user to be worried because everything works as intended. So my point is it would be nice to stop scaring users when nothing is wrong. Sorry if I’m not being very clear. I can see now this is more controversial than I expected. Let’s not do this then. I’m not going to die on this hill. 😛 |
... but that's actionable – you can upgrade your version of Node.js. |
OS limitation could be actionable as well. I'll reopen, it seems worth discussing more. |
We could probably downgrade this to an "info" log level (and introduce concept of log levels like npm has). |
@Gearon Could you provide two complimentary test cases please? I read the details and heard the suggestion. But I'd like to personally take in what you consider a frightening experience for beginners for something that is "almost never actionable". You mentioned Webpack above. To me Webpack itself is frightening and I don't use it as a result. There are a lot of great things that can be done with yarn if it keeps its eyes on the right feature set during development. Is this really a suggestion you feel helps achieve those goals, or are you climbing someone else's hill? |
I'm having somewhat of a similar situation as described by @gaearon: I'm getting warnings on dependencies that themselves use older dependencies and I guess they just haven't upgraded? When I run warning gulp > vinyl-fs > glob-stream > [email protected] ...
warning gulp > vinyl-fs > glob-watcher > gaze > globule > [email protected] ...
warning gulp > vinyl-fs > glob-watcher > gaze > globule > glob > [email protected] ... But when I look at the list that follows, those dependencies are up-to-date. I agree with @gaearon, seeing a warning is a bit scary especially to me since I'm relatively new to using Node and have migrated over from using npm to Yarn. But it's also a bit misleading to see a warning message as it implies that it's something that I can fix. In my opinion, I think that these warnings should either become friendly infos or should just not displayed at all. |
Using unsafe dependencies should give a warning, though. |
Why are we talking about scary. This is software development, not kindergarten. |
@wtgtybhertgeghgtwtg What throws me is that the warning asks me to update something that I can't update. Even though, in this case, I'm not the one using the unsafe dependency (I think Glob is), I do see your point and agree it should be a warning; but I think it can be worded to be more informative. Something as simple as "[dependency_A] is using an outdated [dependency_B]"—I'll know right off the bat that a) it's not my fault, the error is not on my end, and b) where to go to see if the issue has been addressed. That kind of info can save users from going down the rabbit hole of trying to figure out what's wrong on their end. |
Good idea to improve the message first, send a PR
…On 7 July 2017 at 14:08, Daniel Blake ***@***.***> wrote:
@wtgtybhertgeghgtwtg <https://github.com/wtgtybhertgeghgtwtg> What throws
me is that the warning asks *me* to update something that I can't update.
Even though, in this case, I'm not the one using the unsafe dependency (I
think Glob is), I do see your point and agree it should be a warning; but I
think it can be worded to be more informative. Something as simple as
"[dependency_A] is using an outdated [dependency_B]"—I'll know right off
the bat that *a)* it's not *my* fault, the error is not on my end, and
*b)* where to go to see if the issue has been addressed. That kind of
info can save users from going down the rabbit hole of trying to figure out
what's wrong on their end.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#3738 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACBdWI1Ks6bSYH_BStzm_b3-ne3bUMT3ks5sLp5PgaJpZM4OGrsi>
.
|
If you're using a dependency you most certainly own it and everything it pulls in, and have the ability to fork and improve whatever comes with it. If it bothers you perhaps it's not worth using. |
While I would argue that
tells you what you need to know, I agree that it could be worded in a way that summarizes it a bit better. |
Can we keep this issue focused on one particular case please? I don't want this to turn into a bikeshed about all possible warnings. I reported a specific warning where "fixing" the issue is impossible in principle, not even in the transitive dependencies. Everything works as intended. Other cases described in this issue show legitimate problems that need to be reported and fixed by transitive dependencies. I don't think this is similar to the issue I described. If you feel strongly about them please file a new issue. |
If it's related the conversation should probably go right here. Please notice the number of open issues, and that this is an enhancement request and not a bug. |
I trust your good judgement but I trust SO about as far as I can throw a twig. But that's okay. I wanted to send my message for the benefit of others to see how a one line code change could have avoided this entire thread. Sometimes actions speak louder than words. Cheers. |
@JHabdas as much as I appreciate your contributions, I'd like to remind you our code of conduct, specifically the following items:
|
My sincerest apologies. I will review the code of conduct and try and do better to be a good community citizen. Thanks for pointing me in the right direction, @BYK. |
Thanks for fixing this. 😍 🙇 It was the top voted issue in NPM by a wide margin and caused real problems, yet after 1.5 years of not addressing it their bot just auto-closed it for being too old! That kind of project management is one of the reasons I switched to Yarn. Seeing how easy the fix was, it's agonizing how much time and effort was wasted over this. 😢 Thanks! |
Hi, thanks for all the efforts about this. It's far more better that it will be now on my stdout instead of stderror ;). Yet still even info level will bring here tons of people. And the only output they will get after one one hour of reading related issues is that they need to live with it for the moment(who doesn't use babel) and that making platform specific optimization via optional dependencies is possible but with a cost of package managers warnings to the user. I am on a side of having this outputted only at debug level. |
@kubino that's some great feedback, thank you! We are aware that moving it to |
@BYK thank you for still being interested in this. I am far from being expert and maybe I got it wrong. You pointing me to RFC where the title is "make deprecated sub-package warnings more informative". I think delivering DEPRECATED warnings to the users are correct by default (although having a way to suppress particular package warnings would be probably good). |
@kubino no need to be an expert. You know the world is full of self-proclaimed experts, so better to claim not being an expert and may be you'll end up being one 😀 Anyways, I haven't had the time to read that RFC completely yet but I think it falls under the |
@kubino I've updated the RFC description to make it a little easier to use. The RFC is a proposal to try and help address a number of related use cases which might pop-up by introducing a small (seemingly unrelated) feature which, when used creatively, intends to help satisfy needs such as those you've raised while also adding additional benefit to the great work Yarn has already accomplished for the community. Be happy to discuss and use your insights to further enhance the RFC, as I've learned being more experienced can be as much or more of a liability as it can be an asset when it comes to coding. |
If it's optional "given a target OS", then it shouldn't even be WARN level. The author is saying "If MacOS then use FSEvents, otherwise don't." So if you are installing on an OS other than Mac, why warn at all? It's more like info/debug. |
@robertjchristian I think there are two aspects to this:
The core issue is that treating |
Yeah, that was explained several times in the original thread, it seems that nobody listened:
So instead of hiding the warning they should've properly fixed it by implementing conditional dependencies. But that requires changing package.json specification. I imagine something like this:
Another alternative is for fsevents authors:
But that's not much different from hiding the warning on npm level. |
Still no answer? That warning is so annoying. |
At this point I'm tempted to just buy a Mac for the sole purpose of not seeing this for another four years even though I loathe the operating system 👎 |
If you're developing software professionally I couldn't recommend a better investment. |
Why show a warning if you don't require user to do something to correct it? Everyone Arguing to keep the warning, please take a second an think. If user cannot do anything to correct this warning, why we are showing it? It's like your partner telling you they're hungry, you're like cook for yourself, they won't do it, you cook they won't eat, but keep bugging you, I am hungry. Every time you say hi (npm install / yarn), they say I am hungry (WARN WARN WARN).. Seems pointless to me. |
Do you mean you won't see this on Mac?
|
I think you'd have better luck forking chokidar and removing Of course, you'd also have to fork dozens of packages depending on chokidar |
Try complaining here for a change: |
Sounds like we're on the same page after all. xD |
Yeah, I suppose the only choice to wait until chokidar drops support for node 10 at which point it would become useless and other projects start dropping it. |
@Vanuan recent node.js support for fs.watch is still shit. Try actually using it across platforms. If you want to complain about installation warnings, maybe complain to maintainers who "deprecate" packages. That's really fucking annoying. This didn't happen in the past. Fsevents is much less a problem compared to this. |
Is this just never gonna be fixed? |
Ok, so now how do I actually hide these "info" messages? |
Currently Yarn behavior matches npm in that it warns about optional dependencies that are incompatible (and thus skipped).
fsevents
on Windows is a good example of this.Since the warning is almost never actionable, and looks a bit frightening to beginners, I propose that we downgrade its log level. I'm not sure if Yarn even has a concept of log levels, but I wouldn't want to see this warning unless I'm specifically debugging Yarn itself.
Corresponding npm issue has wide support (although it got autoclosed): npm/npm#11632
The text was updated successfully, but these errors were encountered: