[英]Gulpjs – gulp-jade compilation issue
I got an error I can't figure out while using the gulpJs module gulp-jade 使用gulpJs模块gulp -jade时出现错误,无法解决
> [11:13:59] TypeError: listener must be a function
> at DestroyableTransform.addListener (events.js:197:11)
> at DestroyableTransform.Readable.on (/Users/ME/Sites/temp/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:718:33)
> at Gulp.<anonymous> (/Users/ME/Sites/temp/gulpfile.js:14:16)
> at module.exports (/Users/ME/Sites/temp/node_modules/orchestrator/lib/runTask.js:34:7)
> at Gulp.Orchestrator._runTask (/Users/ME/Sites/temp/node_modules/orchestrator/index.js:273:3)
> at Gulp.Orchestrator._runStep (/Users/ME/Sites/temp/node_modules/orchestrator/index.js:214:10)
> at Gulp.Orchestrator.start (/Users/ME/Sites/temp/node_modules/orchestrator/index.js:134:8)
> at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20
> at doNTCallback0 (node.js:428:9)
> at process._tickCallback (node.js:357:13)
I have correctly installed the module and my gulpfile is: 我已经正确安装了模块,而我的gulpfile是:
var gulp = require('gulp');
var jade = require('gulp-jade');
gulp.task('markup', function() {
gulp.src('jade/**/*.jade')
.pipe(jade().on('error', jade.logError))
.pipe(gulp.dest('/build'));
});
The problem is in this line: .pipe(jade().on('error', jade.logError))
- I believe jade
does not contain anything like logError
. 问题是,在这条线: .pipe(jade().on('error', jade.logError))
-我相信jade
不包含像什么logError
。 Try something like this: .pipe(jade().on('error', console.log))
尝试这样的事情: .pipe(jade().on('error', console.log))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.