我正在将 gulp 从 3.9.0 版迁移到 gulp 4.0.0 版。
我在 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);
});});
Run Code Online (Sandbox Code Playgroud)
和 gulp 版本:4.0.0,节点版本:8.11.4
我的错误信息:在此处输入图片描述
请在终端中找到错误消息的图像。
有谁知道我该如何解决这个问题。