question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

macOS `fsevents unavailable (this watcher can only be used on Darwin)`

See original GitHub issue

Environment

  1. code -v : 1.31.0 7c66f58312b48ed8ca4e387ebd9ffe9605332caa x64

  2. node -v: 10.15.1

  3. npm -v: 6.7.0

  4. npm ls jest or npm ls react-scripts (if you haven’t ejected): jest@24.0.0

  5. your vscode-jest settings if customized:

    • jest.pathToJest? blank
    • jest.pathToConfig? blank
    • was working before upgrading VScode to 1.31.0
  6. Operating system: macOS 10.14.3

Prerequisite

  • are you able to run jest test from command line? yes
  • how do you run your tests from command line? (for example: npm run test or node_modules/.bin/jest):
    • npm run test, which is just a shortcut to jest .

Steps to Reproduce

  1. Have Jest Extension installed into older VSCode
  2. Upgrade VSCode to 1.31.1
  3. Open a test/spec file

Relevant Debug Info

Error: `fsevents` unavailable (this watcher can only be used on Darwin)
    at new FSEventsWatcher (/Users/btaylor/Sites/nzta-seatbelts/node_modules/sane/src/fsevents_watcher.js:37:13)
    at createWatcher (/Users/btaylor/Sites/nzta-seatbelts/node_modules/jest-haste-map/build/index.js:952:23)
    at Array.map (<anonymous>)
    at HasteMap._watch (/Users/btaylor/Sites/nzta-seatbelts/node_modules/jest-haste-map/build/index.js:1127:44)
    at _buildPromise._buildFileMap.then.then.hasteMap (/Users/btaylor/Sites/nzta-seatbelts/node_modules/jest-haste-map/build/index.js:441:23)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)

Error: `fsevents` unavailable (this watcher can only be used on Darwin)
    at new FSEventsWatcher (/Users/btaylor/Sites/nzta-seatbelts/node_modules/sane/src/fsevents_watcher.js:37:13)
    at createWatcher (/Users/btaylor/Sites/nzta-seatbelts/node_modules/jest-haste-map/build/index.js:952:23)
    at Array.map (<anonymous>)
    at HasteMap._watch (/Users/btaylor/Sites/nzta-seatbelts/node_modules/jest-haste-map/build/index.js:1127:44)
    at _buildPromise._buildFileMap.then.then.hasteMap (/Users/btaylor/Sites/nzta-seatbelts/node_modules/jest-haste-map/build/index.js:441:23)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)

Error: `fsevents` unavailable (this watcher can only be used on Darwin)
    at new FSEventsWatcher (/Users/btaylor/Sites/nzta-seatbelts/node_modules/sane/src/fsevents_watcher.js:37:13)
    at createWatcher (/Users/btaylor/Sites/nzta-seatbelts/node_modules/jest-haste-map/build/index.js:952:23)
    at Array.map (<anonymous>)
    at HasteMap._watch (/Users/btaylor/Sites/nzta-seatbelts/node_modules/jest-haste-map/build/index.js:1127:44)
    at _buildPromise._buildFileMap.then.then.hasteMap (/Users/btaylor/Sites/nzta-seatbelts/node_modules/jest-haste-map/build/index.js:441:23)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)

Error: `fsevents` unavailable (this watcher can only be used on Darwin)
    at new FSEventsWatcher (/Users/btaylor/Sites/nzta-seatbelts/node_modules/sane/src/fsevents_watcher.js:37:13)
    at createWatcher (/Users/btaylor/Sites/nzta-seatbelts/node_modules/jest-haste-map/build/index.js:952:23)
    at Array.map (<anonymous>)
    at HasteMap._watch (/Users/btaylor/Sites/nzta-seatbelts/node_modules/jest-haste-map/build/index.js:1127:44)
    at _buildPromise._buildFileMap.then.then.hasteMap (/Users/btaylor/Sites/nzta-seatbelts/node_modules/jest-haste-map/build/index.js:441:23)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)

Error: `fsevents` unavailable (this watcher can only be used on Darwin)
    at new FSEventsWatcher (/Users/btaylor/Sites/nzta-seatbelts/node_modules/sane/src/fsevents_watcher.js:37:13)
    at createWatcher (/Users/btaylor/Sites/nzta-seatbelts/node_modules/jest-haste-map/build/index.js:952:23)
    at Array.map (<anonymous>)
    at HasteMap._watch (/Users/btaylor/Sites/nzta-seatbelts/node_modules/jest-haste-map/build/index.js:1127:44)
    at _buildPromise._buildFileMap.then.then.hasteMap (/Users/btaylor/Sites/nzta-seatbelts/node_modules/jest-haste-map/build/index.js:441:23)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)

Starting Jest in Watch mode failed too many times and has been stopped.
 see troubleshooting: https://github.com/jest-community/vscode-jest/blob/master/README.md#troubleshooting

Expected Behavior

Watch mode to work as expected

Actual Behavior

A notification is shown “Starting Jest in Watch mode failed too many times and has been stopped.” and the Jest extension output window is shown with the debug info above.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:27
  • Comments:39

github_iconTop GitHub Comments

546reactions
EdouardBougoncommented, Feb 11, 2019
53reactions
JohnGeorgiadiscommented, Jun 4, 2019

brew install watchman worked for me too, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: `fsevents` unavailable (this watcher can only be used on ...
For me, updating fsevents to the latest fixed the issue. I had the same error as OP with version 1.2.4 , but after...
Read more >
Error: `fsevents` unavailable (this watcher can ... - Expo Forums
Error: `fsevents` unavailable (this watcher can only be used on Darwin) · Clear your Yarn or npm cache, depending on which you're using,...
Read more >
Error: `fsevents` unavailable (this watcher can only be used on ...
npm run test getting: “Error: `fsevents` unavailable (this watcher can only be used on Darwin)”. I don't know this create-react-app based ...
Read more >
React Native ios 填坑之Error: `fsevents` unavailable (this ...
react-native run-ios 运行报错Error: `fsevents` unavailable (this watcher can only be used on Darwin)网上一查两个命令解决,但是.
Read more >
Debugging | Flipper
This means you can debug Flipper using Chrome's developer tools. ... error here is Error: fsevents unavailable (this watcher can only be used...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found