How to fix "Error watch ENOSPC" of React Native in Arch Linux

Arch linux Aug 14, 2018

I’ve been discovering some errors during my journey of React Native development in Arch Linux because most of the time I use macOS and a few others with Windows… but as always, I want to share with you the way I fixed it.

This time something was wrong every time I started the server of React Native with react-native start  and I realised that it was related to the watch of the server so, here is the solution.

By the way, the following steps can also be used in other distributions based on Debian or RedHat.

  • Run the following command in your terminal echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p (this is the global command for Debian/RedHat/Arch)
  • Add this line fs.inotify.max_user_watches=524288 to the file /etc/sysctl.d/99-sysctl.conf
  • Finally execute the following command to make it permanent sysctl --system