Skip to content

Instantly share code, notes, and snippets.

@brunoleles
Last active January 22, 2021 15:10
Show Gist options
  • Save brunoleles/ee689cac84599ab78e415748c241ccfc to your computer and use it in GitHub Desktop.
Save brunoleles/ee689cac84599ab78e415748c241ccfc 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
@mjrulesamrat
Copy link

Great! Worked for me as well. Thanks.

@GettyOrawo
Copy link

Awweeessoommee!!!

@thierryruiz
Copy link

Thanks a lot for sharing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment