gulp-tslint在必要时返回undefined

时间:2016-03-17 16:34:50

标签: gulp tslint

这是我的gulpfile:

/*jslint maxlen:160*/
 (function (require) {
   "use strict";
   var gulp, tslint;
   gulp   = require('gulp');
   tslint = require('gulp-tslint');
   gulp.task("tslint", function() {
    return gulp.src(["src/**/*.ts"])
               .pipe(tslint())
               .pipe(tslint.reporter("verbose"));
   });
 }(require));

当我从命令行运行gulp tslint时出现此错误:

  

[17:26:58]使用gulpfile /var/www/tests/gulp_error/gulpfile.js   [17:26:58]开始' tslint' ... [17:26:58]' tslint'在6.08之后出错   ms [17:26:58] TypeError:undefined不是函数       在Gulp。 (/var/www/tests/gulp_error/gulpfile.js:9:36)       在module.exports(/var/www/tests/gulp_error/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)       在Gulp.Orchestrator._runTask(/var/www/tests/gulp_error/node_modules/gulp/node_modules/orchestrator/index.js:273:3)       在Gulp.Orchestrator._runStep(/var/www/tests/gulp_error/node_modules/gulp/node_modules/orchestrator/index.js:214:10)       在Gulp.Orchestrator.start(/var/www/tests/gulp_error/node_modules/gulp/node_modules/orchestrator/index.js:134:8)       在/home/username/.nvm/versions/node/v0.12.12/lib/node_modules/gulp/bin/gulp.js:129:20       at process._tickCallback(node.js:355:11)       在Function.Module.runMain(module.js:503:11)       在启动时(node.js:129:16)       在node.js:814:3

我在这里做错了什么? 这里有Github repository代码。

0 个答案:

没有答案