Grunt在cdnify:dist任务上失败了

时间:2015-05-17 17:36:33

标签: node.js gruntjs mean-stack meanjs angular-fullstack

我正在使用angular-fullstack yeoman生成器,代码建立在我设置的另一台机器上。我最近买了一台新Mac并克隆了我的回购,我无法用它来构建发行版。

当我尝试使用

构建分发代码时
grunt build

它使cdnify:dist任务失败并显示错误“致命错误:构建器未定义”

我的完整Gruntfile.js就在这里

https://gist.github.com/bodagetta/ad770f7782b52a9e8fb0

以下是终端的相关输出

Running "concat:generated" (concat) task
File .tmp/concat/app/vendor.css created.
File .tmp/concat/app/app.css created.
File .tmp/concat/app/vendor.js created.
File .tmp/concat/app/app.js created.

Running "ngAnnotate:dist" (ngAnnotate) task
>> 2 files successfully generated.

Running "copy:dist" (copy) task
Created 197 directories, copied 1028 files

Running "cdnify:dist" (cdnify) task
Going through dist/public/index.html to update script refs
Fatal error: builder is not defined


Execution Time (2015-05-17 17:31:09 UTC)
loading tasks        75ms  ▇▇ 1%
clean:dist           97ms  ▇▇ 2%
concurrent:dist        1s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 16%
wiredep:target      197ms  ▇▇▇▇▇ 3%
useminPrepare:html  144ms  ▇▇▇ 2%
ngtemplates:main     95ms  ▇▇ 2%
concat:generated    145ms  ▇▇▇ 2%
ngAnnotate:dist      1.2s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 19%
copy:dist            1.6s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 25%
cdnify:dist          1.6s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 26%
Total 6.3s

1 个答案:

答案 0 :(得分:0)

我有同样的问题。本地“grunt build”运行良好,但在Jenkins上它失败了

“正在运行”cdnify:dist“(cdnify)任务
通过dist / public / index.html更新脚本参考号 致命错误:未定义构建器“

所以对我来说问题解决方案是将nodejs版本从0.12.2降级到0.11.14。您可以使用“node -v”命令检查节点版本。要通过npm轻松更新节点版本,请使用http://davidwalsh.name/upgrade-nodejs