咕嘟咕嘟。节点V4。 Typeerror(仅限于观察):Path必须是字符串

时间:2016-08-06 17:55:48

标签: node.js npm gulp watch gulp-watch

所有任务都执行得很好,除了 watchh ,其中使用函数// gulp declarations var gulp = require('gulp'), pug = require('gulp-pug'), copy = require('gulp-copy'), concat = require('gulp-concat'), sass = require('gulp-sass'), uglifycss = require('gulp-uglifycss'), rename = require('gulp-rename'); // other declaration var sq = require('streamqueue'); //allow to write results into stream, rather file output /* * Complete result in a single css file for public using. */ gulp.task('fincss', function () { var convertFromScssToCssAndConcat = gulp.src('./src/sass/*.scss') .pipe(sass().on('error', sass.logError)); var minifyAndConcatExistingCss = gulp.src('./src/css/*.css'); return sq({objectMode: true}, minifyAndConcatExistingCss, convertFromScssToCssAndConcat) .pipe(concat('final.min.css')) .pipe(uglifycss()) .pipe(gulp.dest('./public/css/')); }); gulp.task('pug', function () { return gulp.src(['src/pug/*.pug', '!src/pug/component_*.pug']) .pipe(pug()) .pipe(gulp.dest('public/')); }); gulp.task('watchh', function () { gulp.watch('./src/css/*.css', ['fincss']); gulp.watch('./src/sass/*.scss', ['fincss']); gulp.watch('./src/pug/*.pug', ['pug']); }); 。我真的不知道该怎么做。通过互联网发出与NodeJS v6相同的错误。但我有最新的4大版。 有一个gulp文件

"devDependencies": {
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-pug": "^3.0.4",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.3.2",
"gulp-uglify": "^2.0.0",
"gulp-uglifycss": "^1.0.6",
"gulp-watch": "^4.3.9",
"semantic-ui-css": "^2.2.2",
"streamqueue": "^1.1.1"
  },

npm依赖项

notesList.remove(i); // root problem 
adapter.notifyDataSetChanged();
db.deleteNote(notesList.get(i));

我哪里错了?

1 个答案:

答案 0 :(得分:0)

只有gulp-watch插件才能找到答案。 首先,添加

watch = require('gulp-watch');

其次,任务是

gulp.task('watch', ['fincss'], function () {
    watch([<pathes_here>], function () {
        gulp.run('fincss');
    });
});

感谢所有人的关注。