有人有在 CruiseControl 上运行 gulp 的经验吗? 我们在通过 xml 配置文件自动化该过程时遇到一些麻烦。可以在本地和虚拟机上通过 CommandPrompt 手动启动任务,但从 CruiseControl 启动时出现错误:
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.
非常感谢任何帮助。
更新 在尝试了 Simon Laing 的建议后,开始出现另一个错误:
<buildresults>
<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>
</buildresults>
</build>
</cruisecontrol>
PATH 设置为:%APPDATA%\npm,gulp 通过安装
npm install gulp -g
和
npm install gulp --save-dev
在我看来,配置启动的 Node 在错误的位置搜索 gulp。
最佳答案
Gulp 通过 gulp-cli 从命令行正常执行,这样就不需要执行 node
与 gulp
论证。
要解决您的问题,您需要告诉巡航控制系统哪个可执行文件 (node.exe) 使用哪个工具及其参数运行。
在你的情况下应该是:
- 文件名:
Path\to\node.exe
- 参数:
gulp <any-other-switches>
替代解决方案,让cmd为您执行 Node :
- 文件名:
c:\windows\system32\cmd.exe
- 参数:
/c gulp <any-other-switches>
cmd
然后可以读取路径并执行注释为 gulp-cli
将控制您是否手动调用它。
关于node.js - 在 CruiseControl.NET 上运行 gulp 任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37694154/