zoukankan      html  css  js  c++  java
  • 『奇葩问题集锦』Fedora ubuntu 下使用gulp 报错 Error: watch ENOSPC 解决方案

    用gulp启动,错误如下

    Error: watch ENOSPC
    at exports._errnoException (util.js:746:11)
    at FSWatcher.start (fs.js:1172:11)
    at Object.fs.watch (fs.js:1198:11)
    at Gaze._watchDir (/home/ajaxGu/work/froad/anhui-standard/personal-h5/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:289:30)
    at /home/ajaxGu/work/froad/anhui-standard/personal-h5/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:358:10
    at iterate (/home/ajaxGu/work/froad/anhui-standard/personal-h5/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/helper.js:52:5)
    at Object.forEachSeries (/home/ajaxGu/work/froad/anhui-standard/personal-h5/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/helper.js:66:3)
    at Gaze._initWatched (/home/ajaxGu/work/froad/anhui-standard/personal-h5/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:354:10)
    at Gaze.add (/home/ajaxGu/work/froad/anhui-standard/personal-h5/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:177:8)
    at new Gaze (/home/ajaxGu/work/froad/anhui-standard/personal-h5/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/lib/gaze.js:74:10)

    解决方案:

    当前问题主要是因为gulp的watch需要监听很多文件的改动,但是fedora、ubuntu系统的文件句柄其实是有限制的,因此可以使用以下命令:
    echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

     
  • 相关阅读:
    我的美丽的家乡
    童谣
    有点激动,久违的老家。
    5月8我要发,一个值得纪念的日子
    奥运会上,菲尔普斯拿了8金后,各国的反应....
    2岁半的儿子
    【题解】 「联合省选2020」冰火战士 线段树+二分 LOJ3299
    【题解】 「NOI2017」整数 线段树+二分+压位 LOJ2302
    500 OOPS: cannot change directory:/home/
    Customized Alerts for SQL Server Transactional Replication
  • 原文地址:https://www.cnblogs.com/guxuelong/p/5220913.html
Copyright © 2011-2022 走看看