Skip to content

Instantly share code, notes, and snippets.

@nikola0203
Forked from brunoleles/readme.md
Created April 25, 2019 08:18
Show Gist options
  • Save nikola0203/81f0f1a86f738c3dd0b44f2e33e3efe6 to your computer and use it in GitHub Desktop.
Save nikola0203/81f0f1a86f738c3dd0b44f2e33e3efe6 to your computer and use it in GitHub Desktop.
Gulp Watch Fails with "Error: watch ... ENOSPC"

gulp watch fails with error: Error: watch ... ENOSPC

Stacktrace:

[13:58:28] Starting 'watch'...
[13:58:28] 'watch' errored after 22 ms
[13:58:28] Error: watch /.../resources/assets/images/ ENOSPC
    at exports._errnoException (util.js:1023:11)
    at FSWatcher.start (fs.js:1306:19)
    at Object.fs.watch (fs.js:1331:11)
    at Gaze._watchDir (/.../node_modules/gaze/lib/gaze.js:289:30)
    at /.../node_modules/gaze/lib/gaze.js:358:10
    at iterate (/.../node_modules/gaze/lib/helper.js:52:5)
    at Object.forEachSeries (/.../node_modules/gaze/lib/helper.js:66:3)
    at Gaze._initWatched (/.../node_modules/gaze/lib/gaze.js:354:10)
    at Gaze.add (/.../node_modules/gaze/lib/gaze.js:177:8)
    at new Gaze (/.../node_modules/gaze/lib/gaze.js:74:10)

Fix:

Put a "large" max watches a user can create.

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment