Skip to content

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

@ghost

Description

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/[email protected]
	│  ├─ chokidar@^2.0.3
	├─ [email protected]
	│  ├─ fsevents@^1.2.2
	├─ [email protected]
	│  ├─ chokidar@^2.0.2

EVERY time I exec a yarn command, I see

...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" 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 "[email protected]"
	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/[email protected]

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions