react で "number of file watcher reached" になり yarn start できなかった (ubuntu 18.04)


ubuntu18.04でreacを使い yarn startを実行しようとした所以下のエラーになった

Error: ENOSPC: System limit for number of file watchers reached

原因

system's file watchersの上限を超えていた

対策

以下を実行してファイル監視数の上限を開放する。

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

参考