15

When I do ng serve the log shows errors like this:

Error from chokidar (/PATH_OF_MY_PROJECT/node_modules/ionicons/dist/ionicons/svg): Error: ENOSPC: System limit for number of file watchers reached, watch '/PATH_OF_MY_PROJECT/node_modules/ionicons/dist/ionicons/svg/ios-subway.svg'

I read that the solution is to change watchers file on Linux but that is a bad solution!

Why does Angular need to see changes to node_modules? It is a folder that doesn't change. If I need to install a new library I can restart the server.

Do not answer me if your solution is: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf. I do not want to use this bad solution.

Snackoverflow
  • 5,332
  • 7
  • 39
  • 69
user3909865
  • 175
  • 1
  • 7

1 Answers1

0

I had the same problem and every answer pointed the solution you said.

Doesnt answer me if your solution is: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf

This didn't help me either. I couldn't find a solution, but in webpack you can ignore/exclude the directories you don't want to check just doing the next thing inside your module.exports:

module.exports = {
      target: 'node',
      ...
      watchOptions: {
        ignored: [
          /node_modules/,
          ...
        ],
      },