gulp.series()在运行多个任务时不起作用

时间:2017-06-03 11:28:40

标签: php gulp gulp-watch

我试图以同步方式一个接一个地运行多个gulp任务

但我收到以下错误

  

TypeError:gulp.series不是函数

代码

var progressCircle = {
  init: function(width, height, lineWidth, color) {
    var el = document.getElementById('progressCircle');    
    this.canvas = document.getElementById('progCanvas');
    this.span = document.getElementById('progSpan');
    this.span.textContent = '0%';    
    this.ctx = this.canvas.getContext('2d');
    this.canvas.width = width;
    this.canvas.height = height;
    this.ctx.lineWidth = lineWidth;
    this.ctx.lineCap = 'round';
    this.ctx.translate(width / 2, height / 2);
    this.ctx.rotate(-90*Math.PI/180);    
    this.radius = (width - lineWidth) / 2;
    this.drawCircle("#edc79b", 100);
  },

  drawCircle : function(color, percent) {    
        percent = percent/100;
        this.ctx.beginPath();
        this.ctx.arc(0, 0, this.radius, 0, Math.PI * 2 * percent, false);
    this.ctx.strokeStyle = color;
        this.ctx.stroke();
  }
}

2 个答案:

答案 0 :(得分:2)

如果您想使用 gulp.series gulp.parallel ,您需要gulp 4.0

要获得技术上处于测试阶段但已经存在很长时间的4. +,请使用gulp v4

  

npm i gulp@4.0.0-alpha.2

答案 1 :(得分:0)

您也可以使用以下方法安装gulp版本4。

npm i gulpjs/gulp#4.0 --save-dev