Fsevents: Warning unsupported platform for fsevents

Created on 24 Apr 2017  Â·  9Comments  Â·  Source: fsevents/fsevents

My system:

  • OSX El Capitan v10.11.5
  • Node node -v: v7.9.0
  • NPM npm -v: 4.2.0

I've built a Yarn project. package.json contains the following versions:

...
  "engines" : { 
    "node": ">=7.9.0",
    "npm": ">=4.2.0"
  },
...
  "dependencies": {
    "html-webpack-plugin": "^2.28.0",
    "path": "^0.12.7",
    "webpack": "^2.4.1",
    "webpack-dev-server": "^2.4.4"
  }

Added Webpack dependencies with yarn add webpack webpack-dev-server path.
Created a Dockerfile:

FROM node:alpine
MAINTAINER ltfschoen
RUN mkdir -p /usr/src/app
ADD . /usr/src/app
WORKDIR /usr/src/app
RUN npm install
RUN npm build
EXPOSE 8888
CMD npm start

When I build with the Dockerfile with docker build -t ltfschoen/my-nodejs-app:v1 ., the following warnings are output before the build completes successfully:

...
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm info using [email protected]
npm info using [email protected]
...

When I troubleshoot with npm ls fsevents, it outputs the following:

[email protected] ~/MyApp
└─┬ [email protected]
  └─┬ [email protected]
    └── [email protected]

What's causing these warnings? How do we fix?

Most helpful comment

This warning is not actionable, it tells the developer nothing they need to know and it's just an annoyance for thousands of developers accross the world who see this warning and end up Googling it to try and do something about it.

All 9 comments

fsevents is a wrapper around the OS X subsystem of the same name. There is nothing to fix, "SKIPPING OPTIONAL DEPENDENCY" means it's working as intended.

"www" directory cannot be found. Please make sure the working directory is an Ionic project.
There was an error serving your Ionic application: "www" directory cannot be found. Please make sure the working directory is an Ionic project.

I need help on that please am facing this problem cannot proceed

This warning is not actionable, it tells the developer nothing they need to know and it's just an annoyance for thousands of developers accross the world who see this warning and end up Googling it to try and do something about it.

Then complain to npm, that's what prints the notice.

Thanks, will raise an issue.

For future reference, the issue created on npm is https://github.com/npm/npm/issues/20639

Some quick napkin math gives me an estimate of the number of times the info/warning has been printed in the... billions. And that's not even accounting for the fact that most CI pipelines and yarn are doing quite a lot of caching.

It appears yarn/npm are not going to do anything further about these messages. Is there any way that fsevents could just install on all platforms and just be a no-op, return false, etc on unsupported platforms?

I understand the binary issue, but seems like you could have a JS wrapper that could handle this at runtime.

Is it possible to improve the error message. Something like "fsevents is MacOS X. You are on Linux. Skipping it. Nothing to worry. bye!"

For future reference, the issue created on npm is npm/npm#20639

This repo has been archived and read-only now.

Was this page helpful?
0 / 5 - 0 ratings