Handling ENOSPC Error on VS Code

Crishantha Nanayakkara
1 min readFeb 24, 2019

--

If you are using VS Code for your development, the ENOSPC Error can be a common one. (Especially if you are Linux Debian user).

This basically happens due to the fact that, VS Code file watcher is running out of handles because the workspace is large and contains many files [1].

You can see the current limit by executing the following command:

$ cat /proc/sys/fs/inotify/max_user_watches

The limit can be increased to its maximum by editing /etc/sysctl.conf and adding this line to the end of the file:

fs.inotify.max_user_watches=524288

The above value then can be loaded to the system by executing the following:

$ sudo sysctl -p

If all goes well, you will have no issues with the watches on VS Code.

References:

1. https://code.visualstudio.com/docs/setup/linux#_error-enospc

--

--

Crishantha Nanayakkara
Crishantha Nanayakkara

Written by Crishantha Nanayakkara

Enterprise Architect | Consultant @ FAO (UN) | Former CTO, ICTA Sri Lanka