【问题标题】:Gulp Error: watch ENOSPCGulp 错误:观看 ENOSPC
【发布时间】:2016-12-15 04:00:23
【问题描述】:

您好,我在运行 gulp watch 时遇到此错误。我在 laravel 项目中使用 vueify。为什么会这样。这些天一直运行良好,今天就到了。

$ gulp watch  
[12:56:01] Using gulpfile ~/Documents/web_projects/next-home/gulpfile.js  
[12:56:01] Starting 'watch'...  
[12:56:01] Starting 'browserify'...  
Fetching Browserify Source Files...  
    - resources/assets/js/app.js  
Saving To...  
   - public/js/app.js  
[12:56:02] Finished 'browserify' after 707 ms  
[12:56:02] 'watch' errored after 722 ms  
[12:56:02] Error: watch /home/bazi/Documents/web_projects/next-home/resources/assets/less/ ENOSPC  
    at exports._errnoException (util.js:893:11)  
    at FSWatcher.start (fs.js:1313:19)  
    at Object.fs.watch (fs.js:1341:11)  
    at Gaze._watchDir (/home/bazi/Documents/web_projects/next-home/node_modules/gaze/lib/gaze.js:289:30)  
    at /home/bazi/Documents/web_projects/next-home/node_modules/gaze/lib/gaze.js:358:10
    at iterate (/home/bazi/Documents/web_projects/next-home/node_modules/gaze/lib/helper.js:52:5)  
    at Object.forEachSeries (/home/bazi/Documents/web_projects/next-home/node_modules/gaze/lib/helper.js:66:3)  
    at Gaze._initWatched (/home/bazi/Documents/web_projects/next-home/node_modules/gaze/lib/gaze.js:354:10)  
    at Gaze.add (/home/bazi/Documents/web_projects/next-home/node_modules/gaze/lib/gaze.js:177:8)  
    at new Gaze (/home/bazi/Documents/web_projects/next-home/node_modules/gaze/lib/gaze.js:74:10)  
events.js:154  
      throw er; // Unhandled 'error' event  
      ^  
Error: watch /home/bazi/Documents/web_projects/next-home/package.json ENOSPC  
    at exports._errnoException (util.js:893:11)  
    at FSWatcher.start (fs.js:1313:19)  
    at Object.fs.watch (fs.js:1341:11)  
    at createFsWatchInstance (/home/bazi/Documents/web_projects/next-home/node_modules/chokidar/lib/nodefs-handler.js:37:15)  
    at setFsWatchListener (/home/bazi/Documents/web_projects/next-home/node_modules/chokidar/lib/nodefs-handler.js:80:15)  
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/bazi/Documents/web_projects/next-home/node_modules/chokidar/lib/nodefs-handler.js:228:14)  
    at FSWatcher.NodeFsHandler._handleFile (/home/bazi/Documents/web_projects/next-home/node_modules/chokidar/lib/nodefs-handler.js:255:21)  
    at FSWatcher.<anonymous> (/home/bazi/Documents/web_projects/next-home/node_modules/chokidar/lib/nodefs-handler.js:473:21)  
    at FSReqWrap.oncomplete (fs.js:82:15)  

这是我的 gulpfile.js

var elixir = require('laravel-elixir');
require('laravel-elixir-vueify');
elixir(function(mix) {
    mix.less('app.less');
    mix.browserify('app.js');
});

【问题讨论】:

标签: less browserify gulp-watch laravel-elixir


【解决方案1】:

来自http://www.samundra.com.np/solved-gulp-watch-error-enospc/1386 尝试这个: 为什么会出现这个问题?系统中可以观看的文件数量是有限制的。我们必须增加这个数字。下面的命令可以用来增加这个数字。

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

相关链接 https://github.com/gulpjs/gulp/issues/217

它对我有用。或者减少您的观察者需要观看的文件数量。

【讨论】:

    【解决方案2】:

    您必须在系统配置中增加监视文件的数量。运行此命令,它将为您工作

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

    【讨论】:

      猜你喜欢
      • 2013-05-20
      • 2015-11-07
      • 2020-09-24
      • 2016-07-09
      • 1970-01-01
      • 1970-01-01
      • 2017-01-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多