Я пытаюсь установить eslint и jasmine phantom jasmine через npm, и я не думаю, что все работает правильно.Вот мой файл глотка
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync').create();
var eslint = require('gulp-eslint');
var jasmine = require('gulp-jasmine-phantom');
browserSync.stream();
gulp.task('default', ['styles', 'lint'], function() {
gulp.watch('/sass/**/*.scss', gulp.parallel('styles'));
gulp.watch('js/**/*.js', gulp.parallel('lint'));
gulp.watch('index.html', browserSync.reload);
browserSync.init({
server:"./"
});
});
gulp.task('styles', function() {
gulp.src('sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions']
}))
.pipe(gulp.dest('./css'))
});
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 failAfterError last.
.pipe(eslint.failAfterError());
});
gulp.task('tests', function () {
gulp.src('tests/spec/extraSpec.js')
.pipe(jasmine( {
integration: true,
vendor: 'js/**/.*js'
}));
});
И вот ошибка, которую я получаю, когда запускаю «gulp»
$ gulp assert.js: 42 выдает новые ошибки.AssertionError ({^
AssertionError [ERR_ASSERTION]: Функция задания должна быть указана в Gulp.set [as_setTask] (C: \ Users \ davek \ OneDrive \ Udacity - Google \ Gulp \ my-project \ node_modules\ предпринять \ lib \ set-task.js: 10: 3) в Gulp.task (C: \ Users \ davek \ OneDrive \ Udacity - Google \ Gulp \ my-project \ node_modules \ предпринять \ lib \ task.js:13: 8) в объекте (C: \ Users \ davek \ OneDrive \ Udacity - Google \ Gulp \ my-project \ gulpfile.js: 10: 6) в модуле Module._compile (module.js: 653: 30) вObject.Module._extensions..js (module.js: 664: 10) в Module.load (module.js: 566: 32) в tryModuleLoad (module.js: 506: 12) в Function.Module._load (модуль.js: 498: 3) в Module.require (module.js: 597: 17) по требованию (internal / module.js: 11: 18)
Спасибо за помощь.
Dave