Skip to content

[QUESTION] How to properly get rid of npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents #1112

@OnkelTem

Description

@OnkelTem

Hi all.

I found several topics discussing how to get rid of messages like these:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/webpack-dev-server/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/watchpack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

and it seems like npm i -f is gonna "fix" this issue, but unfortunately what has never been explained is what exactly it's doing and how it's working.

Another advice was to run npm i with parameter --no-optional.
Well, first - I'm not gonna skip other optionals as well just because npm complains about this one (which one cannot even install on Linux).
And second - it's not convenient to run npm with additional --no-optional parameter every time, eh?

So my question is: how to get rid of this specific warning about "fsevents" which is not supposed to be installed on Linux? Is there a way to add some "rule" or something into package.json to not warn on standard OSes like Linux and keep it showing on proprietary ones?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions