学盟网是一个互助、分享,一起学习和成长的公益平台,学盟网,有你更精彩!按Ctrl+D收藏学盟网!
当前位置:首页 > 电脑 > linux → 怎样处理Linux下gulp报错Error:watch ENOSPC

怎样处理Linux下gulp报错Error:watch ENOSPC

时间:2016-11-30 16:21:12 作者:andy 来源:linux 阅读:

在Fedora和Ubuntu的操作系统下使用gulp的时候, gulp报错Error:watchENOSPC ,这是怎么回事?下面小编就为大家带来了处理Linux下gulp报错Error:watch ENOSPC的方法。

处理Linux下gulp报错Error:watch ENOSPC方法

72-160302154425111.jpg

用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

123

文章目录

CopyRight © 2011-2016 学盟网 www.xuenb.com All Rights Reserved.

'); })();