Error: watch ENOSPC

原文章:https://blog.csdn.net/elliotnotebook/article/details/54599994

在Fedora和Ubuntu的操作系统中,使用gulp时出现问题,gulp报错Error:watch ENOSPC的问题

出现类似这种错误可以试试

 

Error: watch ENOSPC

    at errnoException (fs.js:1024:11)
    at FSWatcher.start (fs.js:1056:11)
    at Object.fs.watch (fs.js:1081:11)
    at startWatcher (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:359:27)
    at watchDir (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:392:14)
    at compilePath (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:139:9)
    at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:98:20)
    at Object.<anonymous> (/usr/local/lib/node_modules/coffee-script/bin/coffee:7:41)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3

当前问题主要是因为gulp的watch需要监听很多文件的改动,但是fedora、ubuntu系统的文件句柄其实是有限制的,因此可以使用以下命令:

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

  对于以上Linux下gulp报错Error:watch ENOSPC的解决方法就介绍完了
---------------------
作者:ElliotNotebook
来源:CSDN
原文:https://blog.csdn.net/elliotnotebook/article/details/54599994
版权声明:本文为博主原创文章,转载请附上博文链接!

posted @ 2019-04-16 11:24  elseliving的记录  阅读(196)  评论(0编辑  收藏  举报