[React Native] How I resolved various ENOSPC errors
by Riley MacDonald, March 11, 2018

While writing a React Native application on Linux using nodejs and npm I experienced several ENOSPC (error no space) errors. This error is defined as “No space available for writing onto the storage device.”. Strange, I’ve only used ~15% of my disk, there’s lots of space available.

Additionally Visual Studio Code and Android Studio threw warnings indicating my inotify limit was too low. The Visual Studio Code documentation instructed me to increase the limit to the maximum:

When you see this notification, it indicates that the VS Code file watcher is running out of handles because the workspace is large and contains many files.

Print the current inotify limit
To print the current inotify limit execute the following command:

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

Increase the limit
Add the following line to your /etc/sysctl.conf:

fs.inotify.max_user_watches=524288

Reload the sysctl changes by executing:

$ sudo sysctl -p
fs.inotify.max_user_watches = 524288

This seems to have resolved the ENOSPC errors I was experiencing.

Open the comment form

Leave a comment:

Comments will be reviewed before they are posted.

User Comments:

Pongo on 2019-05-08 06:45:20 said:
worked like a charm!