user5554178 user5554178 - 4 months ago 51x
Node.js Question

Running gulp tasks on CruiseControl.NET

Does anyone have any experience of running gulp on CruiseControl?
We have some troubles to automate the process through xml config file. Tasks can be launched through CommandPrompt manually on local and virtual machines, but when launched from CruiseControl there is an error:

ThoughtWorks.CruiseControl.Core.Tasks.BuilderException: Unable to execute: gulp TaskName

System.IO.IOException: Unable to execute file [D:\CC.NET\VSS\%CorrectPathName%\gulp]. The file may not exist or may not be executable.

Any help is much appreciated.

After trying out what Simon Laing has suggested, started to get another error:

<message level="Error">module.js:327</message>
<message level="Error"> throw err;</message>
<message level="Error"> ^</message>
<message level="Error">Error: Cannot find module 'D:\CC.NET\VSS\Path\to\the\project\gulp'</message>
<message level="Error"> at Function.Module._resolveFilename (module.js:325:15)</message>
<message level="Error"> at Function.Module._load (module.js:276:25) </message>
<message level="Error"> at Function.Module.runMain (module.js:441:10) </message>
<message level="Error"> at startup (node.js:139:18)</message>
<message level="Error"> at node.js:968:3</message>

The PATH was set to: %APPDATA%\npm, gulp was installed through

npm install gulp -g


npm install gulp --save-dev

It seems to me config launches node that is searching for gulp in a wrong place.


Gulp is executed normally from the command line via the gulp-cli, which removes the need to execute node with the gulp argument.

To resolve your issue you need to tell cruise control which executable (node.exe) to run with which tool and it's arguments.

In your case it should be:

  • Filename: Path\to\node.exe
  • Arguments: gulp <any-other-switches>

Alternative solution, get cmd to execute node for you:

  • Filename: c:\windows\system32\cmd.exe
  • Arguments: /c gulp <any-other-switches>

cmd can then read the path and execute note as gulp-cli would control if you were invoking it manually.