错误:任务需要Gulp.Orchestrator.add上的名称

时间:2016-03-08 23:13:52

标签: node.js dependencies gulp

我正在构建一个Node Web App并在Windows 10上进行本地测试。自从我上次成功运行以来,该节点模块orchestrator似乎已经安装,可能是一些依赖。现在我收到了这个错误。造成这种情况的原因是什么?如何解决?

C:\Users\George\Source\Repos\MakeSensePortal>gulp
[23:02:53] Requiring external module babel-register
C:\Users\George\Source\Repos\MakeSensePortal\node_modules\orchestrator\index.js:37
                        throw new Error('Task requires a name');
                        ^

Error: Task requires a name
    at Gulp.Orchestrator.add (C:\Users\George\Source\Repos\MakeSensePortal\node_modules\orchestrator\index.js:37:10)
    at Object.<anonymous> (build_html.js:7:6)
    at Module._compile (module.js:413:34)
    at loader (C:\Users\George\Source\Repos\MakeSensePortal\node_modules\babel-register\lib\node.js:126:5)
    at Object.require.extensions.(anonymous function) [as .js] (C:\Users\George\Source\Repos\MakeSensePortal\node_modules\babel-register\lib\node.js:136:7)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at requireDir (C:\Users\George\Source\Repos\MakeSensePortal\node_modules\require-dir\index.js:116:33)

或者,如果我删除它是否重要? - 是的,然后我得到一个错误,说无法找到Orchestrator,它似乎在我的babel-register中被引用...

更新

我不确定它是否已链接,但每当我尝试运行npm update等时,我都会遇到有关reflect-metadata的对等依赖性问题,但如果我尝试安装它,请参阅下文:

C:\Users\George\Source\Repos\MakeSensePortal>npm i reflect-metadata
MakeSensePortal@0.0.1 C:\Users\George\Source\Repos\MakeSensePortal
+-- passport@0.3.2
`-- UNMET PEER DEPENDENCY reflect-metadata@0.1.3

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.8
npm WARN optional Skipping failed optional dependency /browser-sync/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.8
npm WARN angular2@2.0.0-beta.9 requires a peer of reflect-metadata@0.1.2 but none was installed.

1 个答案:

答案 0 :(得分:7)

在我的案例中,任务名称后面缺少逗号(与wassname相同):

gulp.task('name' ['...']);

正确版本:

gulp.task('name', ['...']);