Skip to content
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

Filter out fsevents warning/info on non supported OS messages #2564

Closed
aikar opened this issue Jan 27, 2017 · 14 comments
Closed

Filter out fsevents warning/info on non supported OS messages #2564

aikar opened this issue Jan 27, 2017 · 14 comments

Comments

@aikar
Copy link

aikar commented Jan 27, 2017

Do you want to request a feature or report a bug?

Feature

What is the current behavior?
The following prints on linux:

warning fsevents@1.0.17: The platform "linux" is incompatible with this module.
info "fsevents@1.0.17" is an optional dependency and failed compatibility check. Excluding it from installation.

What is the expected behavior?
Yarn should suppress this message when verbose flag is not passed, as it's provides no feedback and only confuses users new to npm/yarn (I had to explain to someone that it's a harmless warning)

Please mention your node.js, yarn and operating system version.
yarn 0.19.1, node 6.9.4, linux

@ljqx
Copy link

ljqx commented Jan 28, 2017

yarn --ignore-optional --ignore-platform ?

@aikar
Copy link
Author

aikar commented Jan 29, 2017

Why would you want to type that every single time you run yarn?

I tried putting the following in ~/.yarnrc, .yarnrc in project folder, and even in yarn lock:

ignoreOptional "true"
ignorePlatform "true"
ignore-optional "true"
ignore-platform "true"

None of them work. I didnt know these were CLI commands, so I guess my request is to make hide optionals default, and make it --show-optional-warnings

and hide platform errors if the dep is optional.

You wouldn't want to block all of these warnings, as you might try to actually use something thats not optional and you need to know.

but cases like fsevents is 100% useless to see it, and should be default to not see it.

@clavecoder
Copy link

Please add this to your roadmap as it is confusing to packager users to get spurious warnings. I've tried to get the warning hid by the node team with no success. See nodejs/node#7858

@RichiCoder1
Copy link

I'll add that there is an option to filter out optional, it just doesn't work with install for some reason. See #2666

@dead-claudia
Copy link

Related: npm/npm#2006

@bestander
Copy link
Member

Discussion here #3738

@gaearon
Copy link
Contributor

gaearon commented Jul 8, 2017

Note: --ignore-optional is not a correct solution.

In case of fsevents (most common case) ignoring it causes very slow watching solution to be used instead on OS X. The desired behavior is to still install it when possible but not warn if not.

I only leave this comment here for future readers who might think --ignore-optional is a good solution. Let's keep discussion in the other issue.

@whereisaaron
Copy link

I am really tired of seeing this useless fsevents warning year after year. It is not even relevant or useful or a warning on any platform except MacOS. If your OS is not MacOS then not installing this is expected and correct behavior and so nothing to WARN anyone about.

This situation pushes people to filter out all warnings or use --ignore-optional because of this erroneous warning. It is so prevalent it practically deserves special-case code to suppress it! It causes build failures and we end up with special wrappers to grep it out. 😞

@sebastiangug
Copy link

2020 checking in, this is still a frustrating thing

@dead-claudia
Copy link

Still waiting on either npm or Yarn to allow gating a dependency based on OS. 😉

Not a dev of either, obviously.

@ctrongminh
Copy link

I think currently we can use a workaround like alias:
alias yarn='yarn --ignore-platform'

I tested with --ignore-platform and it doesnt show warning about the fsevents

@andreyors
Copy link

echo '--ignore-platform true' > .yarnrc

@whereisaaron
Copy link

whereisaaron commented May 22, 2020

Yeah @ctrongminh @andreyors, I don’t love it, but is the best option available to users to address these erroneous warnings.

@jerza90
Copy link

jerza90 commented Jan 24, 2022

Able to do this with below script in working folder.

echo '--ignore-platform true' > .yarnrc

@yarnpkg yarnpkg locked as resolved and limited conversation to collaborators Jan 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests