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

后端 未结 12 697
小鲜肉
小鲜肉 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:04

    Add a nodemon.json configuration file in your root folder and specify ignore patterns for example:

    nodemon.json

    {
      "ignore": [
        "*.test.js", 
        "dist/*"
      ]
    }
    
    • Note that by default .git, node_modules, bower_components, .nyc_output, coverage and .sass-cache are ignored so you don't need to add them to your configuration.

    Explanation: This error happens because you exceeded the max number of watchers allowed by your system (i.e. nodemon has no more disk space to watch all the files - which probably means you are watching not important files). So you ignore non-important files that you don't care about changes in them for example the build output or the test cases.

提交回复
热议问题