我是新来的节点并在任何“适当”环境下开发。我已经为我当前的项目安装了gulp,还有mocha和其他一些模块。这里是我的gulpfile.js:“Finishing”之后的吞咽挂钩
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var eslint = require('gulp-eslint');
gulp.task('lint', function() {
return gulp.src(['js/**/*.js'])
// eslint() attaches the lint output to the eslint property
// of the file object so it can be used by other modules.
.pipe(eslint())
// eslint.format() outputs the lint results to the console.
// Alternatively use eslint.formatEach() (see Docs).
.pipe(eslint.format())
// To have the process exit with an error code (1) on
// lint error, return the stream and pipe to failOnError last.
.pipe(eslint.failOnError());
});
gulp.task('test', function() {
return gulp.src('tests/test.js', {read: false})
// gulp-mocha needs filepaths so you can't have any plugins before it
.pipe(mocha({reporter: 'list'}));
});
gulp.task('default', ['lint','test'], function() {
// This will only run if the lint task is successful...
});
当我运行“一饮而尽”,这似乎完成所有工作,但挂起。我必须按Ctrl + C返回到命令提示符。我如何才能正确完成?
您自己运行的任何任务('一饮而尽test','一饮而尽lint'),难道他们挂?我已经在这里剪切和粘贴你的代码,并且没有任何问题可以运行它。没有东西挂起。 – Louis
我会稍后再试,谢谢。 – Ooberdan