【发布时间】:2019-09-17 18:11:01
【问题描述】:
我正在处理从 3.9.0 版到 gulp 4.0.0 版的 gulp 迁移。
我在 gulp.src('') 上的 gulpfile.js 中遇到错误,错误消息是“错误:无效的 glob 参数:”
我在 gulpfile.js 中的 gulp.task() 看起来像这样 -
gulp.task('build-version', function(done) {
var dir = path.build + '/js',
filename = "build.js";
gulp.src('')
.pipe(ngConfig('ppm', {
createModule: false,
constants: {
newUIBuildVersion: buildVersion
}
}))
.pipe(rename(filename))
.pipe(gulp.dest(dir));
// lint build.js file
return gulp.src(dir + '/' + filename)
.pipe(jshint(config.jshint))
.pipe(jshint.reporter(stylish))
.pipe(jshint.reporter('fail'))
.on('error', function(err) {
log(err);
});});
gulp 版本:4.0.0,Node 版本:8.11.4
我的错误信息:enter image description here
请在终端中找到错误信息的图片。
有没有人知道我该如何解决这个问题。
【问题讨论】:
-
你这里什么都没有: :
gulp.src(''). -
是的,我知道,但我以前的 gulpfile.js 版本只有空字符串,它工作得非常好。任何建议我可以在 gulp.src('') 中传递什么。
-
感谢您的回复,非常感谢。
标签: javascript gulp