138
votes

I'm trying to run this project. After updating minimatch version to 3.10.9, I'm getting the following error:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\webpack\node_modules\watchpack\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})

My configuration:

Node v - 4.4.2
npm v - 3.10.9
32 bit windows OS
3
Doesn't sound like an error to me - are you having trouble running the code despite this? npm WARN is just that - a warning that might be worth paying attention to, but didn't actually break anything.Aurora0001
And this particular warning is just telling you that an optional dependency did not install because your platform didn't match it's requirements. In this case it's looking for darwin and you are on win32Dave V
its a grunt project, after running this command "npm install -g grunt-cli", i try to run npm install when i get this warning,Aishwary Tiwari
@AishwaryTiwari, did you actually get an error, or does the code not work? Warnings are unlikely to be an actual problem, because (as the error message says), it skipped an optional dependency.Aurora0001
There is a pull request that fixes the problem: github.com/npm/npm/pull/19198 You can subscribe to that pull request, so you get an update when it will be closed.RiZKiT

3 Answers

171
votes

It's a warning, not an error. It occurs because fsevents is an optional dependency, used only when project is run on macOS environment (the package provides 'Native Access to Mac OS-X FSEvents').

And since you're running your project on Windows, fsevents is skipped as irrelevant.

There is a PR to fix this behaviour here: https://github.com/npm/cli/pull/169

37
votes

This still appears to be an issue, causing package installations to be aborted with warnings about optional packages no being installed because of "Unsupported platform".

The problem relates to the "shrinkwrap" or package-lock.json which gets persisted after every package manager execution. Subsequent attempts keep failing as this file is referenced instead of package.json.

Adding these options to the npm install command should allow packages to install again.

   --no-optional argument will prevent optional dependencies from being installed.

   --no-shrinkwrap argument, which will ignore an available package lock or
                   shrinkwrap file and use the package.json instead.

   --no-package-lock argument will prevent npm from creating a package-lock.json file.

The complete command looks like this:

    npm install --no-optional --no-shrinkwrap --no-package-lock

nJoy!

19
votes

Using parameter --force:

npm i -f