Error: `fsevents` module is not installed

Setting up my development area on MacOS Catalina 10.15.5 (19F101) following https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md

When running YARN START I get the below error.

 New platform optimizer error  Error: `fsevents` module is not installed, most likely because you need to follow the instructions at https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md and re-bootstrap Kibana
    at Rx.defer (/Applications/Elastic/kibana/packages/kbn-optimizer/src/run_optimizer.ts:48:17)
    at Observable._subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/observable/defer.ts:59:15)
    at Observable._trySubscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:238:19)
    at Observable.subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:219:14)
    at MergeMapOperator.call (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/operators/mergeMap.ts:100:19)
    at Observable.subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:214:25)
    at DoOperator.call (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/operators/tap.ts:81:19)
    at Observable.subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:214:25)
    at Observable._subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/observable/defer.ts:65:19)
    at Observable._trySubscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:238:19)
    at Observable.subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:219:14)
    at DoOperator.call (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/operators/tap.ts:81:19)
    at Observable.subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:214:25)
    at Observable._subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/observable/defer.ts:65:19)
    at Observable._trySubscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:238:19)
    at Observable.subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:219:14)
error Command failed with exit code 1.

On https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md where it directs you there is an acid test. My system passes the test.

TMC-acbc3297f415:kibana user$ curl -L https://github.com/nodejs/node-gyp/raw/master/macOS_Catalina_acid_test.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   150  100   150    0     0    358      0 --:--:-- --:--:-- --:--:--   357
100   495  100   495    0     0    523      0 --:--:-- --:--:-- --:--:--   523
Command Line Tools version: 11.5.0.0.1.1588476445

Any idea what to try next?

Those instructions also contain steps to take after your system passes the acid test but fails to run: did you try those?

I don't see any other steps passed acid test. Where do you see additional steps? Maybe I am missing something.

If test succeeded, you are done !

This is my full error.

TMC-acbc3297f415:kibana user$ yarn start
yarn run v1.22.4
$ node scripts/kibana --dev
  log   [13:43:08.874] [warning][plugins-discovery] Explicit plugin paths [/Applications/Elastic/kibana/x-pack] should only be used in development. Relative imports may not work properly in production.
  log   [13:43:08.966] [warning][plugins-discovery] Expect plugin "id" in camelCase, but found: beats_management
  log   [13:43:08.972] [warning][plugins-discovery] Expect plugin "id" in camelCase, but found: triggers_actions_ui
  log   [13:43:20.060] [info][plugins-service] Plugin "visTypeXy" is disabled.
  log   [13:43:20.061] [info][plugins-service] Plugin "ingestManager" is disabled.
  log   [13:43:20.061] [info][plugins-service] Plugin "lists" is disabled.
  log   [13:43:20.061] [info][plugins-service] Plugin "securitySolution" has been disabled since some of its direct or transitive dependencies are missing or disabled.
  log   [13:43:20.097] [warning][legacy-plugins] Unable to scan directory for plugins "/Applications/Elastic/kibana/plugins"
  log   [13:43:21.150] [info][plugins-service] Plugin initialization disabled.
  log   [13:43:21.161] [warning][savedobjects-service] Skipping Saved Object migrations on startup. Note: Individual documents will still be migrated when read or written.
 New platform optimizer error  Error: `fsevents` module is not installed, most likely because you need to follow the instructions at https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md and re-bootstrap Kibana
    at Rx.defer (/Applications/Elastic/kibana/packages/kbn-optimizer/src/run_optimizer.ts:48:17)
    at Observable._subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/observable/defer.ts:59:15)
    at Observable._trySubscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:238:19)
    at Observable.subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:219:14)
    at MergeMapOperator.call (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/operators/mergeMap.ts:100:19)
    at Observable.subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:214:25)
    at DoOperator.call (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/operators/tap.ts:81:19)
    at Observable.subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:214:25)
    at Observable._subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/observable/defer.ts:65:19)
    at Observable._trySubscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:238:19)
    at Observable.subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:219:14)
    at DoOperator.call (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/operators/tap.ts:81:19)
    at Observable.subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:214:25)
    at Observable._subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/observable/defer.ts:65:19)
    at Observable._trySubscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:238:19)
    at Observable.subscribe (/Applications/Elastic/kibana/node_modules/rxjs/src/internal/Observable.ts:219:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

The acid test part passes for me. It says if it passes you are good. If not do the other steps.

If test succeeded, you are done ! You should be ready to install node-gyp .

If test failed, there is a problem with your Xcode Command Line Tools installation. Continue to Solutions.

What other steps on this page am I missing?

Okay. Did you try running yarn kbn bootstrap before running yarn start?

Yes. Everything works until I get to yarn start with no errors.

TMC-acbc3297f415:kibana user$ yarn kbn bootstrap
yarn run v1.22.4
$ node scripts/kbn bootstrap
 info [kibana] running yarn

$ node ./preinstall_check
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
warning Resolution field "typescript@3.9.5" is incompatible with requested version "typescript@~3.7.2"
success Already up-to-date.

 succ 15 bootsrap builds are cached
✨  Done in 4.39s.

There is nothing obviously wrong with your setup. As it shows in our contributing guide, we advice using yarn kbn clean to reset everything and then try those steps again. Some of our operations folks have also asked whether you have the kibana/node_modules/fsevents folder or if it's missing.

There is no kibana/node_modules/fsevents

I checked that earlier and I attempted to copy/paste another one based on a system drive search and it threw more errors. Where do I find the correct one?

There isn't a "correct one" to copy unfortunately, it needs to be built by yarn during bootstrap. If you run yarn --force in the root of the Kibana directory what output do you get?

Ran clean and now bootstraping again. Looks like the folder is there now. I am guessing when it imported packages the first time it just didn't grab it for whatever reason.

Thanks for the help.

Yeah, in this scenario yarn doesn't know it needs to try reinstalling fsevents again, doing a clean will force it to. Glad it's working now.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.