Contents

System Limit for Number of File Watchers Reached

TL;DR

Using the Jest plugin in Vue.js in Linux:

1
npx vue-cli-service test:unit --watch

And you receive this error on your Linux PC:

Error: ENOSPC: System limit for number of file watchers reached, watch…

Open up Terminal, and to resolve the error, run:

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

Source

The Rest of the Story

I’ll be the first to admit that I have way too way interests, and not enough time. How this relates, is that now I am going through some Vue.js tutorials.

After running the following command while learning about the Jest plugin in Vue.js:

1
npx vue-cli-service test:unit --watch

I received this error:

Error: ENOSPC: System limit for number of file watchers reached, watch…

Apparently, this is a Linux issue. Currently I’m running Linux Mint 19.1.

Run the following command in the Terminal to resolve the issue:

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

Source

And here is where I discovered the solution. Big thanks to the original poster!

Original post: https://github.com/facebook/jest/issues/3254#issuecomment-297214395

Hope this helps someone else find this solution quicker :-)

End of Line.