DEV Community

Shajahan A
Shajahan A

Posted on

ENOSPC: System limit for number of file watchers reached | Ubuntu | Emberjs

If you are facing this issues

Stack Trace and Error Report: /tmp/error.dump.9d22f10a74fb98f66d5b433d74cf4b9c.log
internal/fs/watchers.js:173
    throw error;
    ^

Error: ENOSPC: System limit for number of file watchers reached, watch '/home/mymachine/ember-app/tests/helpers'
    at FSWatcher.start (internal/fs/watchers.js:165:26)
    at Object.watch (fs.js:1329:11)
    at NodeWatcher.watchdir (/home/home/mymachine/node_modules/sane/src/node_watcher.js:159:22)
    at Walker.<anonymous> (/home/home/mymachine/node_modules/sane/src/common.js:109:31)
    at Walker.emit (events.js:223:5)
    at Walker.EventEmitter.emit (domain.js:475:20)
    at /home/home/mymachine/node_modules/walker/lib/walker.js:69:16
    at FSReqCallback.oncomplete (fs.js:146:23) {
  errno: -28,
  syscall: 'watch',
  code: 'ENOSPC',
  path: 'home/mymachine/tests/helpers',
  filename: 'home/mymachine/tests/helpers'
}
Enter fullscreen mode Exit fullscreen mode

while working with emberjs in ubunut? Don't worry! We can fix it. It is just hitting your system's file watchers limit.

To increase the file watchers limit we need to do certain things, first
enter the following command in your terminal

cat /proc/sys/fs/inotify/max_user_watches

You might get output like this some integer.
8192

Now increase the limit by entering the next command

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

The above command will set your file watcher limit to 524288. To see whether it is set or not, type

sudo sysctl -p

output
fs.inotify.max_user_watches = 524288

Now, again run your ember server and it'll work fine.

I hope this post is helful to you, if yes then give a heart. Please comment if you have any issues. Do let me know if you need more emberjs related posts.

Top comments (15)

Collapse
 
danhiel98 profile image
danhiel98

Thanks, it also works in deepin

Collapse
 
fmontenegro0510 profile image
Francisco

Thanks a lot! You are Great!!

Collapse
 
vineyrawat profile image
Viney Rawat

Thanks, You saved my day.

Collapse
 
danireptor profile image
Daniel Bemsen Akosu • Edited

Thanks Alot, it work in Elementary

Collapse
 
abdelhakaj profile image
Abedelhak Ajbouni

thanks man

Collapse
 
siam88 profile image
Rafshanul Hoque Siam

Thanks a lot

Collapse
 
mariocalin profile image
Mario

Works like a charm in Ubuntu 20.04.

Thank you so much.

Collapse
 
jeromeburce11 profile image
JeromeBurce

It works! Thank you!

Collapse
 
skb0110 profile image
Santosh Biswakarma

Great, Thanks a lot.

Collapse
 
golam_mostafa profile image
Golam_Mostafa

It works on Zorin, thanks a lot