fsevents is installed by default with npm on Mac OS and Windows operating systems. The error "is not a constructor" might mean you tried to initialize fsevents in your code. Most likely with the new keyword. Please review your code for this, if not let me know.


what you have to do is very simple. Run the following

rm -rf node_modules/ package-lock.json  

and then

npm i

This worked for me.


I had the same issue after a fresh install of node and create-react-app. After some searching I found this article [1] about a known issue with running npm test.

After installing watchman, tests are running.



Any time I did create-react-app, I got this exact error when I immediately ran 'npm test'. This worked for me if I already was committed to the React project:

npm install fsevents@1.2.11

After some digging, I found out that I needed to manually install this package because CRA pumped out several

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 ...

messages during the initial install. And yet, I needed this package to run 'npm test'.

However, my bigger issue was that CRA was skipping this dependency install because it wasn't detecting xcode on my system. I was getting these messages:

gyp: No Xcode or CLT version detected!

The solution is to run the command

xcode-select --install

Now, any future create-react-app's should operate smoothly without needing any additional dependency installs! Additional Xcode troubleshooting here.


Had similar issue on OSX. If you have Homebrew, just run following command in terminal and try again:

brew install watchman 

If it doesn't help, try running following commands in terminal:

sudo rm -rf (xcode-select -print-path)
xcode-select --install

Related Query

More Query from same tag