Error: fsEvents is not a function (using Jest and create-react-app)
See original GitHub issueI keep getting an error “fsEvents is not a function” when I run npm test
Fragment in package.json
"test": "react-scripts test"
Error upon running npm test
TypeError: fsevents is not a function
at new FSEventsWatcher (node_modules/jest-runtime/node_modules/jest-haste-map/build/lib/FSEventsWatcher.js:162:20)
at createWatcher (node_modules/jest-runtime/node_modules/jest-haste-map/build/index.js:1052:23)
at Array.map (<anonymous>)
at HasteMap._watch (node_modules/jest-runtime/node_modules/jest-haste-map/build/index.js:1230:44)
at node_modules/jest-runtime/node_modules/jest-haste-map/build/index.js:517:21
at Generator.next (<anonymous>)
at asyncGeneratorStep (node_modules/jest-runtime/node_modules/jest-haste-map/build/index.js:193:24)
at _next (node_modules/jest-runtime/node_modules/jest-haste-map/build/index.js:213:9)
React scripts version: 3.0.1 (also tried 3.4.0) Node version: v12.16.1 npm version: 4.6.1
I have tried changing the version of Node (downgrading, upgrading to latest) - doesn’t work, also downgraded npm to 4.x per another post’s recommendation - doesn’t work. Also tried installing the latest version of Chokidar (which I don’t otherwise require as a dependency in the project).
What could be the issue?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:11
- Comments:13
Top Results From Across the Web
ReactJS Test - fsevents is not a function
fsevents is installed by default with npm on Mac OS and Windows operating systems. The error ...
Read more >fsevents
Start using fsevents in your project by running `npm i fsevents`. There are 4266 other projects in the npm registry using fsevents.
Read more >jest-haste-map fsevents is not a function, fsevents is not a ...
info fsevents@1.2.11: The platform "linux" is incompatible with this module. ... Doing an npm install -g create-react-app isn't really a solution per se, ......
Read more >Testing Asynchronous React - Turing: Front-End Curriculum
Run the test suite given by create-react-app to make sure it works: ... getting the error TypeError: MutationObserver is not a constructor while...
Read more >Error: error:0308010C:digital envelope routines::unsupported
I am facing this error while deploying my react application ... fsevents 1 will break on node v14+ and could be using insecure...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
i ran
brew install watchman
and that fixed it for me. not sure if it’s because i’m usingfish
andfish-nvm
or because i just set up a new laptop on apple’s new os catalina.still using npm, we can’t switch to yarn atm
i have the same type error. old advices to remove
node_modules
andyarn.lock
or installfsevents
do not work.