为什么我在运行监视任务时获得TypeError: _.flattenDeep is not a function
这是我的gulpfile.js:
var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('gulp-autoprefixer');
var cleanCSS = require('gulp-clean-css');
gulp.task('css', function(){
gulp.src('public/sass2/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(sourcemaps.write())
.pipe(autoprefixer())
.pipe(gulp.dest('public/css'))
});
gulp.task('default', function() {
gulp.watch('public/sass2/**/*.scss', ['css']);
});
使用监视任务时我总是遇到此错误,如何通过它?
答案 0 :(得分:0)
尝试在项目中安装lodash
npm i --save lodash