Node.JS: Getting error : [nodemon] Internal watch failed: watch ENOSPC

后端 未结 12 691
小鲜肉
小鲜肉 2020-12-07 07:49

I just installed Node.js on my Ubuntu 14.04 operating system for the first time. I also installed npm. The next step in my installatio

12条回答
  •  一整个雨季
    2020-12-07 08:03

    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
    

    But the way it was written first will make this change permanent.

提交回复
热议问题