Linux下gulp报错Error:watch ENOSPC的解决方法
时间:2023-08-08 19:18:17
在Fedora和Ubuntu的操作系统下使用gulp的时候,gulp报错Error:watch ENOSPC,这是怎么回事?最近很多用户都遇到这样的问题,Linux下gulp报错Error:watch ENOSPC怎么办?下面,小编就给大家介绍Linux下gulp报错Error:watch ENOSPC的解决方法。
gulp报错
用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
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Win10系统盘瘦身技巧 win10删除并禁止生成系统错误内存转储文件
![](https://img.aspxhome.com/file/2023/30/a263384_0s.png)
word 中样式快捷键设置图解教程
![](https://img.aspxhome.com/file/2023/9/32609_0s.jpg)
Win7系统限制电脑网速的操作方法
![](https://img.aspxhome.com/file/2023/3/a296465_0s.jpg)
Excel 2019如何设置唯一值条件格式的操作方法
![](https://img.aspxhome.com/file/2023/9/a141069_0s.jpg)
Win8如何设置图片密码登录
![](https://img.aspxhome.com/file/2023/29/a258342_0s.jpg)
WPS模板助你成为职业达人
![](https://img.aspxhome.com/file/2023/9/a164929_0s.jpg)
Win7如何修改管理员账户名称?
![](https://img.aspxhome.com/file/2023/1/a282843_0s.jpg)
WPS怎么添加删除批注
电脑路由器如何限速?路由器限速设置教程
![](https://img.aspxhome.com/file/2023/6/a326554_0s.jpg)
xp系统分区无任何文件依然显示被占用了几百MB空间
电脑无法修改系统时间怎么办?
![](https://img.aspxhome.com/file/2023/6/a323134_0s.jpg)
暴风转码怎么裁剪视频?暴风转码裁剪视频的方法介绍
![](https://img.aspxhome.com/file/2023/7/a330964_0s.jpg)
Win7显示未识别的网络怎么处理?
![](https://img.aspxhome.com/file/2023/27/a230390_0s.jpg)
Win7系统怎么设置防火墙 电脑开启防火墙的方法
![](https://img.aspxhome.com/file/2023/2/a287444_0s.jpg)
XP系统如何使用QQ远程协助?
![](https://img.aspxhome.com/file/2023/4/a307997_0s.png)
Excel截取中文的综合函数应用举例
![](https://img.aspxhome.com/file/2023/4/38694_0s.gif)
Sketch实例教程:制作一个时钟
![](https://img.aspxhome.com/file/2023/3/a211793_0s.jpeg)
如何善用WPS Office让菜鸟成为图片大师
![](https://img.aspxhome.com/file/2023/1/a167191_0s.jpg)
POCO相机怎么切换镜头?POCO相机切换镜头的方法
![](https://img.aspxhome.com/file/2023/8/a334659_0s.jpg)
如何编辑艺术作品/封面艺术和标签, MediaHuman YouTube Downloader使用教程
![](https://img.aspxhome.com/file/2023/5/a213655_0s.png)