首页 热点 业界 科技快讯 数码 电子消费 通信 前沿动态 电商

焦点!Linux下gulp报错Error:watch ENOSPC怎么办?

2023-07-01 07:41:54 来源 : 互联网

最近有用户反映,在Fedora和Ubuntu操作系统下使用gulp时遇到问题,gulp报错Error:watch ENOSPC,这是怎么回事?Linux下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)

解决方案:

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

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

以上就是Linux下gulp报错Error:watch ENOSPC解决方案,遇到同样问题用户赶紧试试上面方法吧!

标签:

相关文章

最近更新
首次发布!100→990.55 2023-07-01 06:44:58
龙舟竞渡方寸间 2023-07-01 06:07:12