Running Jest on Linux

August 17, 2017

I frequently switch between devices and operating systems and recently ran into a strange bug when running unit tests in Linux. Jest would run just fine on macOS and Windows, but when I ran my tests on Linux I would receive an error message mentioning ENOSPC. This error traditionally means the hard drive is out of space.

In my case, however, I was running into an issue because I was attempting to monitor more files than the default limit in Ubuntu. Running the following command seems to fix the issue:

echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

This permanently updates the amount of watchers on the system avoiding the issue that was previously encountered. See here for a more detailed explanation


Ryan Lanciaux

Hi 👋 I'm Ryan Lanciaux. I run Spaceship Studio, LLC. a consultancy specializing in fast and dynamic web and native mobile applications.

I live in Ann Arbor with my wonderful family! In my freetime, I create electronic music.

You should follow me on Twitter