npm runs successfully but terminal process stopped (system limit)

Viewed 337

I'm studying Vue js and when I try to run npm run watch it says that Build successfully but next for some reasons terminal process stops and I get an error like:

Error from chokidar (/var/www/html/rankUp/node_modules/axios): Error: ENOSPC: System limit for number of file watchers reached, watch '/var/www/html/rankUp/node_modules/axios'

In fact, it worked fine a few minute ago(I haven't any changes in code), but when I restart my PC and re run npm run watch I got that! By the way, I should say that noticed weird action by axios I was trying to handle api data with axios, next when I comment whole axios code, I saw that it still worked idk how? maybe that is a reason of that erros?

Does anyone have an idea? why it happend?

1 Answers

If you are facing this error once you are trying to execute npm start, it’s because of your max_user_watches was reached the maximum number. Simply you can increase the max_user_watches by running this command :

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

And then you can run npm start again

Related