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

Change fsevents from optional -> conditional dependency; don't generate warnings on OS' it's not intended for #779

Closed
ghost opened this issue Dec 5, 2018 · 7 comments

Comments

@ghost
Copy link

ghost commented Dec 5, 2018

I run yarn 1.12.3


yarn --version
	1.12.3

node --version
	v11.3.0


lsb_release -rd
	Description:    openSUSE Leap 15.0
	Release:        15.0

yarn list | egrep "babel/cli|chokidar|fsevent"
	├─ @babel/cli@7.2.0
	│  ├─ chokidar@^2.0.3
	├─ chokidar@2.0.4
	│  ├─ fsevents@^1.2.2
	├─ fsevents@1.2.4
	│  ├─ chokidar@^2.0.2

EVERY time I exec a yarn command, I see

...
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
...

I've not directly required fsevents.

Checking

yarn why fsevents
	yarn why v1.12.3
	[1/4] Why do we have the module "fsevents"...?
	[2/4] Initialising dependency graph...
	[3/4] Finding dependency...
	[4/4] Calculating file sizes...
	=> Found "fsevents@1.2.4"
	info Reasons this module exists
	   - "@babel#cli#chokidar" depends on it
	   - Hoisted from "@babel#cli#chokidar#fsevents"
	Done in 1.28s.

I do have a direct dependency for

yarn list | grep babel/cli
├─ @babel/cli@7.2.0

which includes

node_modules/@babel/cli/package.json
	...
	  },
	  "optionalDependencies": {
	    "chokidar": "^2.0.3"
	  },
	...

and in

node_modules/chokidar/package.json
	...
	  },
	  "optionalDependencies": {
	    "fsevents": "^1.2.2"
	  },
	...

I do want to continue using babel/cli.

This 'fsevents' message provides no useful information; it's just noise. It's obviously NOT being used on this platform, 'linux'. IIUC, it's intended for MacOS only.

Can this incessant fsevents message be silenced?

A seemingly sane option is to make fsevents a platorm-specific, CONTITIONAL dependency, as discussed/suggested here:

yarnpkg/yarn#3738 (comment)

@ghost ghost changed the title Change fsevents from optional -> conditional dependency; don't generated warnings on OS' it's not intended for Change fsevents from optional -> conditional dependency; don't generate warnings on OS' it's not intended for Dec 5, 2018
@ghost
Copy link
Author

ghost commented Feb 2, 2019

npm - package.json OS specific dependency - Stack Overflow for related discussion.

@sth
Copy link

sth commented Feb 17, 2019

The warning is annoying and pointless, but since npm doesn't actually have a "conditional dependency" feature that's not a solution...

@paulmillr
Copy link
Owner

yeah — nothing we can do here

I agree the warning is annoying.

@NathanielHill
Copy link

This problem has been around for at least 5 years.

I wonder how much money this has cost; some people pay for CI logs by line... 🤔

@ghost
Copy link
Author

ghost commented Feb 20, 2019

Please don't trip over dollars to pick up pennies. Who wrote your CI logger? Perhaps you could reach out to them and ask how to squelch the warning so you can save yourself a couple pennies.

@NathanielHill
Copy link

@jhabdas This wasn't a complaint directed at chokidar/paulmillr per se. More an observation made in frustration. Realistically, this is more of an npm problem than anyone else. Although, I do believe fsevents could potentially solve this as well by doing something like installing on *nix but being a no-op 🤷‍♂️

Although, some quick napkin math would indicate that we're talking much more than pennies potentially:

Seeing as how this has been a problem for the better part of a decade, and it's approaching 10,000,000 downloads a week (with the vast majority of those being CI)...

We're already in the billions of lines printed and that's not even accounting for the fact that most CI pipelines and yarn do a pretty good job of caching. 🤦‍♂️

@ghost
Copy link
Author

ghost commented Feb 22, 2019

I thought napkin math was supposed to accompany a beer. :)~ Nevertheless I believe you hit the nail on the head—this is squarely an issue with NPM as far as I'm aware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants