最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - gulp.js - dest.on is not a function - Stack Overflow

programmeradmin5浏览0评论

I am attempting to pile my styles.scss with gulp-sass when I recieve the following error:

[09:48:49] Starting 'e'...
[09:48:49] 'e' errored after 2.35 ms
[09:48:49] TypeError: dest.on is not a function
    at DestroyableTransform.Readable.pipe (D:\Data\Web Development\Repositories\ds-www\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:485:8)
    at Gulp.<anonymous> (D:\Data\Web Development\Repositories\ds-www\gulpfile.js:44:6)
    at module.exports (D:\Data\Web Development\Repositories\ds-www\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (D:\Data\Web Development\Repositories\ds-www\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (D:\Data\Web Development\Repositories\ds-www\node_modules\orchestrator\index.js:214:10)
    at D:\Data\Web Development\Repositories\ds-www\node_modules\orchestrator\index.js:279:18
    at finish (D:\Data\Web Development\Repositories\ds-www\node_modules\orchestrator\lib\runTask.js:21:8)
    at module.exports (D:\Data\Web Development\Repositories\ds-www\node_modules\orchestrator\lib\runTask.js:60:3)
    at Gulp.Orchestrator._runTask (D:\Data\Web Development\Repositories\ds-www\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (D:\Data\Web Development\Repositories\ds-www\node_modules\orchestrator\index.js:214:10)

I have gulp-sass installed in another project and works correctly - with the same gulpfile.js which means it must be a problem with in the node_modules folder.

Here is the gulpfile.js for reference:

var gulp = require('gulp');
var sass = require('gulp-sass');

gulp.task('e', function(){
  gulp.src('app/admin/assets/sass/*.scss') // ## Not working
    .pipe(sass())
    .pipe('dist/admin/assets/css');
});

gulp.task('default', ['e'], function(){
  console.log('Gulp tasks started!');
});

How can I fix this problem?

I am attempting to pile my styles.scss with gulp-sass when I recieve the following error:

[09:48:49] Starting 'e'...
[09:48:49] 'e' errored after 2.35 ms
[09:48:49] TypeError: dest.on is not a function
    at DestroyableTransform.Readable.pipe (D:\Data\Web Development\Repositories\ds-www\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:485:8)
    at Gulp.<anonymous> (D:\Data\Web Development\Repositories\ds-www\gulpfile.js:44:6)
    at module.exports (D:\Data\Web Development\Repositories\ds-www\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (D:\Data\Web Development\Repositories\ds-www\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (D:\Data\Web Development\Repositories\ds-www\node_modules\orchestrator\index.js:214:10)
    at D:\Data\Web Development\Repositories\ds-www\node_modules\orchestrator\index.js:279:18
    at finish (D:\Data\Web Development\Repositories\ds-www\node_modules\orchestrator\lib\runTask.js:21:8)
    at module.exports (D:\Data\Web Development\Repositories\ds-www\node_modules\orchestrator\lib\runTask.js:60:3)
    at Gulp.Orchestrator._runTask (D:\Data\Web Development\Repositories\ds-www\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (D:\Data\Web Development\Repositories\ds-www\node_modules\orchestrator\index.js:214:10)

I have gulp-sass installed in another project and works correctly - with the same gulpfile.js which means it must be a problem with in the node_modules folder.

Here is the gulpfile.js for reference:

var gulp = require('gulp');
var sass = require('gulp-sass');

gulp.task('e', function(){
  gulp.src('app/admin/assets/sass/*.scss') // ## Not working
    .pipe(sass())
    .pipe('dist/admin/assets/css');
});

gulp.task('default', ['e'], function(){
  console.log('Gulp tasks started!');
});

How can I fix this problem?

Share Improve this question asked Oct 4, 2016 at 8:56 Josh MurrayJosh Murray 6375 silver badges18 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

Your destination should be written like :

gulp.task('e', function(){
  gulp.src('app/admin/assets/sass/*.scss') // ## Not working
    .pipe(sass())
    .pipe( gulp.dest('dist/admin/assets/css') );
});

In order to pipe properly to your destination folder.

发布评论

评论列表(0)

  1. 暂无评论