现有的gulp任务错误"任务' dev'不在你的gulpfile"当作为npm脚本运行时

时间:2018-04-26 14:59:28

标签: node.js npm gulp

简而言之:我的gulpfile中有一项任务。我gulp mytask时运行正常。但是当我尝试将它用作npm' start脚本时,我收到错误。

设定:

//gulpfile.js (gulp 4)

var dev = gulp.series(a,series,of,tasks);
gulp.task('dev', dev);

gulp dev按预期行事:a运行,然后运行series等。

但是当我在package.json

中添加gulp dev作为我的npm start脚本时
{
  ...
  "scripts": {
    "start": "gulp dev"
  }
}

npm start错误

npm start

> my-project@1.0.0 start correct/path/to/project
> gulp dev

Using gulpfile correct/path/to/gulpfile.js
Task 'dev' is not in your gulpfile
Please check the documentation for proper gulpfile formatting

我错过了什么?

1 个答案:

答案 0 :(得分:0)

我在Gulp v4.0.0-alpha.1上。不确定是怎么回事,但没关系:)使用Gulp v4.0.0它按预期工作。

相关问题