简体   繁体   English

Gulp /管道中未处理的流错误

[英]Gulp / Unhandled stream error in pipe

I wrote a gulp file that works but...not at any attempts. 我写了一个gulp文件,但是没有任何尝试。

Indeed, I get this weird error 1 time / 3 : 确实,我得到这个奇怪的错误1次/ 3

[12:25:51] Starting 'default'...
[12:25:51] Starting 'clean'...
[12:25:51] Finished 'clean' after 2.96 ms
[12:25:51] Starting 'fonts'...
stream.js:94
      throw er; // Unhandled stream error in pipe.
            ^
Error: ENOENT, chmod '/Users/UserName/Desktop/frontend/src/assets/fonts/lato/lato-bold-webfont.eot'

I even tried setting chmod -R 777 on the frontend folder, but doesn't work either. 我什至尝试在frontend文件夹中设置chmod -R 777 ,但也不起作用。

Is this a known issue / bug? 这是已知问题/错误吗? I read all over the web but can't find any good explanation. 我在网上阅读了所有内容,但找不到任何好的解释。

Concerned Task is: 有关任务是:

// copy fonts
gulp.task('fonts', function () {
    return gulp
        .src(['client/assets/fonts/**/*.*', '!client/assets/fonts/**/*.html'])
        .pipe(gulp.dest(path.join(targetDir, '/assets/fonts')))
        .pipe(browserSync.stream())
        .on('error', errorHandler);
});

I decided to try with the following gulp task (despite being deprecated) to clean directories; 我决定尝试执行以下gulp任务 (尽管已弃用)以清理目录; instead of del : 代替del

gulp.task('clean', function (cb) {
    rimraf('./' + targetDir, cb);
});

And it always works! 而且它始终有效!

Why isn't the del command stable? 为什么del命令不稳定? I don't know. 我不知道。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM