Gulpjs - gulp-jade汇编问题

时间:2015-12-08 14:59:21

标签: javascript node.js gulp pug

我在使用gulpJs模块时无法弄清楚 gulp-jade

[1] " ipsum dolor"                     "sit amet, consectetur adipiscing"
[3] ", sed do eiusmod tempor"          "incididunt ut labore"            
[5] "et  magna aliqua."

我已经正确安装了模块,我的gulpfile是:

> [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)

1 个答案:

答案 0 :(得分:1)

问题在于这一行:.pipe(jade().on('error', jade.logError)) - 我认为jade不包含logError之类的内容。尝试这样的事情:.pipe(jade().on('error', console.log))