Log failed optional platform dependencies as info. #19198
Log failed optional platform dependencies as info. #19198
Conversation
Also, it has been suggested that a more elegant enhancement to NPM would be to be able to specify that some of a package's dependencies are "platform-specific." Even given that were true, I still think this is a worthwhile error message to make less loud in this context. Yes, in theory, it could be a useful message if someone installed and was about to immediately attempt to use a package incompatible with their platform, as the optional dependency would not be found when required. But, practically, whoever is installing the rare platform-specific package as an optional dependency probably knows what they're doing. Most people unaware of the platform-specific quality of a package would probably discover the quality as a result of installing the package as a normal dependency, as incompatible platform errors are still displayed outside the optional context. Of course, as discussed in other issues, the error mostly serves to needlessly frighten package consumers, which seems to far outweigh the fringe use case I mentioned. Regarding describing packages as being "platform-specific," I actually prefer the current "approach" NPM has taken (intentional or not), which seems to be implied by the description of
The implication being: " |
Any update with this ? |
Good initiative Jackson. Don't give up.
…On Feb 9, 2018 03:41, "Jackson Ray Hamilton" ***@***.***> wrote:
Anyone? @iarna <https://github.com/iarna> @zkat <https://github.com/zkat>
@othiym23 <https://github.com/othiym23>
I’ll accept if you’re busy, but at least *say something*. There are other
contributions I’d like to make to NPM, but if they’re never going to even
be acknowledged, why bother?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#19198 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AWbQgkRKdpzmJL7l_8KpH4DWDqDdAae_ks5tSyPPgaJpZM4QjzsD>
.
|
@jacksonrayhamilton Hello there, I found this PR while searching for fsevents that confirmed to be a problem in my company apps. Yes the npm "Warn" us about the OS especially with the fsevents case. I think that this is quite "fatal" to change "warn" into "info" as I found out without this specific module, there are delay with functions and variables' value in our apps (Development in MacOS while deploy in Ubuntu Server). So I think that if it "Warn", there might be problems that you won't know until you find out that it would cause quite a "fatal" case. It might be good to solve it rather than skipping it. I'll share a bit why this must be fix while it "warn". At my company, we skip this module and cause delay issues with features that I develop myself. At first I thought there might be something wrong with my code and then I refactor my code. Made a fix and push to git and deploy. (Note that I refactor my code entirely 4 times and I feel a bit burnt out and decided to check up with the devops team because I thought how could my code get wrong? wtf happened? 4 times refactor but the bug still there?) But still the delay bug won't go away until I find out there is something wrong with script in Jenkins (Automation deploy tool that we use) that it skip the optional dependencies. At last decided to push entire node_modules to git so that the Ubuntu server could build / run production mode without error. But now I still searching for alternative to fsevents because it's not a good way to force a module from different environment or platform to be use in another one. |
@vandyw95 I don’t quite understand how skipping this dependency causes issues for you. You describe a “delay” but I don’t know what this means. |
The related github issues comprehensively discuss why this change needs to be implemented to address the specific case. @vandyw95 I would suggest reading the related issues first to better grasp why this change and PR has been submitted. There is no reason to repeat what has already been discussed. |
@jacksonrayhamilton So the delay I had is with the variables' value that changes while watching another functions triggered under certain condition (event). In my case, there are several checkbox that have custom value (a JSON) and several label that watch a variable(array type) with value (using reduce function) that being pushed from the checkbox's JSON.variable every time the checkbox triggered. Let's say there are 4 checkbox (a, b, c, and d) with value comes from an endpoint API request. Delay -> When I checked checkbox a the Label shows "0" (should show "1"), when I checked b the Label shows "1" (should show "3") Delay only happens in Production server which is Ubuntu (Developers develop with MacOS) edit Note that the production server skip the optional because it is just a "WARN" reducing the log level of nonfatal errors << I would say that this is a bit fatal as what I do by ignoring the "WARN" at first @YasharF Yes as I had said earlier, why don't you read about my problem? :) Maybe there would be the same issue as what I had now |
@vandyw95 the error you describe seems to be a production client-side browser issue. The warning I want to suppress occurs during an |
@jacksonrayhamilton FYI I'm not here mainly to discuss about fsevents but to remind and let you know that what I do to fix bug is to include that fsevents even though different environment (Yea, like what you said it shouldn't affected). But if fact, it works without changing my code. So then, how "WARN" should be lower because it shouldn't affecting things and etc. As said before, "shouldn't affecting" sounds like lack of confidence in a statement. Like I said, you won't know something is wrong until you feel the pain. :) |
@vandyw95 So to understand right, you added fsevents, which is for Node based tools to get file system events on MacOS X and added this to your Ubuntu production enviroment, to improve the performance of ajax requests!? That's kinda magic! But as long as is solves your problem, go for it, please. I would have suggested, debug your checkbox functionality with plain javascript, maybe just in the browser console, there you can already use fetch and async/await and with a gaze at the network tab find the bottleneck. |
@RiZKiT Yes it's magic and I'm a magician graduated from Hogwarts :) |
@vandyw95 I think you have not finished debugging your problem, committing the entire As has been stated, if (process.platform !== 'darwin')
throw new Error('Module \'fsevents\' is not compatible with platform \'' + process.platform + '\''); |
Something like this is a good idea. The current model of dumping tons of errors has been a pretty painful thing at times. I'm not going to make a call on this specific patch this week 'cause I'd like to get more of a discussion with @iarna about it and I see this as lower priority than the reams of other PRs I'm gonna be going through this week. Hang in there, though, we'll have a better response on our next pass :) (and thanks for filing this -- it's totally a legit use case!) |
What is there to discuss? It's crystal clear what the community wants: #11632 Just merge this. |
I'd like to note that once this fsevent dependency gets pulled in by any package, all further installs of future packages will result in the same warning being displayed again and again and again. |
Hi @zkat - any updates? When might that happen? Thanks 🙏 |
@spottedmahn It is, indeed, a matter of prayer. |
Oh, I so much like this "community-driven" development. What should we do for merge this PR? Find some collaborators and to threaten him with a gun? |
I give up. I just moved our company over to Yarn. The NPM governance is just absurd. |
@0rvar good fix! I'll try it too. |
I agree. I understood Yarn to be an innovation, but after NPM “caught up” with lockfiles, I figured it would be wiser to stick with NPM as the “de-facto” package manager. That was a mistake. NPM’s lack of agency is pathetic. It is so disappointing to my sense of free software idealism, that a project needs to be entirely rewritten and rebranded for the right to merge patches, as is the case with the emergence of Yarn. SORRY NPM; I WAS WILLING TO WRITE FREE CODE FOR YOU, BUT YOU IGNORED ME, SO I WILL NO LONGER DO THAT |
@jacksonrayhamilton I don't think the developers are ignoring this on purpose, they probably a) haven't seen it, or b) don't have time right now. |
@legodude17 they need to click one button to merge this. What is a problem? Anyway, I switch our project to yarn yesterday, so I don't care 'bout npm. |
@Amareis they also need to review it and test it and such. |
So... Can we vote for new project collaborators with write access or something? It's been half a year. |
Hi! We're moving repos to https://github.com/npm/cli/pulls! See our blog post about the migration to npm.community for details. As such, we're closing all active PRs on this repo. Could you please re-open this PR against |
Eh, maybe in a year or two. |
Fixes #11632, reducing the log level of nonfatal errors when installing optional dependencies on an unsupported platform (e.g.
fsevents
on GNU/Linux). Adapts the changes from #12841 to the current state of the repo and endeavors to implement the requested changes in this issue comment.In the last two PRs that attempted to address this, it was suggested a "debug" error level be used, but it does not seem like "debug" exists as an error level in
npmlog
. "info" seems to have similar intent though, and it does eliminate the message by default: