George Edwards George Edwards - 6 months ago 53
Node.js Question

Error: Task requires a name at Gulp.Orchestrator.add

I am building a Node Web App and testing it locally on Windows 10. At some point since my last successful run, this node module

orchestrator
seems to have been installed, presumably as some dependency. Now I am getting this error. What is causing this and how do I fix it?

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)


Alternatively, does it matter if I remove it? - Yes, I then get an error saying that Orchestrator cannot be found, and it seems to be referenced in my babel-register...

Update:

I am not sure if it is linked, but whenever I try to run npm update etc. I get peer dependency issues about reflect-metadata, yet if I try to instal it - see below:

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.

Answer

A comma was missing just after the task name in my case (same case as wassname) :

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

Correct version :

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