Sunday, April 10, 2022

[SOLVED] Inotify max file limit

Issue

I am programming react app with electron in a docker environment. When I try to npm run dev, I got the following error :

Error from chokidar (/home/app/mountpoint/Matres-GUI/node_modules/@pmmmwh/react-refresh-webpack-plugin/lib/runtime): Error: ENOSPC: System limit for number of file watchers reached, watch '/home/app/mountpoint/Matres-GUI/node_modules/@pmmmwh/react-refresh-webpack-plugin/lib/runtime'

But I can't increase the amount of inotify watchers because I have no root access to edit /etc/sysctl.conf

Is there a way to drop all the watchers set ?


Solution

Finally found a solution here

Just add CHOKIDAR_USEPOLLING=true npm start to a local .env file



Answered By - R1'
Answer Checked By - Candace Johnson (WPSolving Volunteer)