I am working on reactjs web application project.
While I am working on project react web application. Several times hot reload happen. But when an error occurred during development then it gives following error.
[nodemon] Internal watch failed: watch ENOSPC
After that, I need to process for following command in Ubuntu which will help me to run a project again. Otherwise, the reactjs application will keep crashing.
sudo pkill -9 node
sudo pkill -9 npm
Is there any other solution that will help me to run reactjs web application without error message of Internal watch failed?
This type of errors can come in Ubuntu OS. I had the same issue about [nodemon] Internal watch failed: watch ENOSPC
ENOSPC issue is referring fro disk space, temp memory size or could be different but an error is coming from node.js
If you are using ubuntu then it can be solved by the following command:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
After running this command just restart your react or node application.
It appears that my max ports weren’t configured correctly. I ran the following code and it worked…
echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
What this command does is to increase the number of watches allowed for a single user. By the default the number can be low (8192 for example). When nodemon
tries to watch large numbers of directories for changes it has to create several watches, which can surpass that limit.
You could also solve this problem by:
sudo sysctl fs.inotify.max_user_watches=582222 && sudo sysctl -p
Please Visit Here For Other Solution