Skip to content

Instantly share code, notes, and snippets.

@hawkapparel
Created December 13, 2018 05:25
Show Gist options
  • Save hawkapparel/6e4743a7485f94e38273d1711c423289 to your computer and use it in GitHub Desktop.
Save hawkapparel/6e4743a7485f94e38273d1711c423289 to your computer and use it in GitHub Desktop.
Error: watch /var/www/shards/public ENOSPC
ERROR:
yarn run v1.12.3
$ vue-cli-service serve
INFO Starting development server...
10% building modules 1/1 modules 0 activeevents.js:183
throw er; // Unhandled 'error' event
^
Error: watch /var/www/shards/public ENOSPC
at FSWatcher.start (fs.js:1382:19)
at Object.fs.watch (fs.js:1408:11)
at createFsWatchInstance (/var/www/shards/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/var/www/shards/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/var/www/shards/node_modules/chokidar/lib/nodefs-handler.js:232:14)
at FSWatcher.NodeFsHandler._handleDir (/var/www/shards/node_modules/chokidar/lib/nodefs-handler.js:414:19)
at FSWatcher.<anonymous> (/var/www/shards/node_modules/chokidar/lib/nodefs-handler.js:462:19)
at FSWatcher.<anonymous> (/var/www/shards/node_modules/chokidar/lib/nodefs-handler.js:467:16)
at FSReqWrap.oncomplete (fs.js:153:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
SOLUTION:
From my findings its not related to Jest at all. On Linux (or Mac) we have a max number of system watchers we can place at an IO level (from my understanding). So for large projects, it seems that Jest is trying to watch just way to many files.
To fix:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
Source: Node.JS Error: ENOSPC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment