When running jest react tests on my Chromebook Pixelbook, I saw this:
$ node ./node_modules/.bin/react-scripts test --env=jsdom Error: ENOSPC: no space left on device, watch '/home/chronos/user/Downloads/Projects/blahblahblah-chrome/app' at FSWatcher.start (internal/fs/watchers.js:164:26) at Object.watch (fs.js:1232:11) at NodeWatcher.watchdir (/home/chronos/user/Downloads/Projects/blahblahblah-chrome/app/node_modules/sane/src/node_watcher.js:150:20) at new NodeWatcher (/home/chronos/user/Downloads/Projects/blahblahblah-chrome/app/node_modules/sane/src/node_watcher.js:46:8) at createWatcher (/home/chronos/user/Downloads/Projects/blahblahblah-chrome/app/node_modules/jest-haste-map/build/index.js:575:23) at Array.map (<anonymous>) at HasteMap._watch (/home/chronos/user/Downloads/Projects/blahblahblah-chrome/app/node_modules/jest-haste-map/build/index.js:703:25) at _buildPromise._buildFileMap.then.then.hasteMap (/home/chronos/user/Downloads/Projects/blahblahblah-chrome/app/node_modules/jest-haste-map/build/index.js:262:21)
I have plenty of disk space available, that is definitely not the problem.
Running this command fixed it:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
This bumps the number of files you can watch at any given time. The error is incorrectly reported by the react script tool as an issue with disk space, but that is not the case.
The link to the issue and the solution is here:
https://github.com/facebook/jest/issues/3254#issuecomment-297214395