【发布时间】:2013-01-10 09:51:33
【问题描述】:
我没有运气使用 grunt 构建 jQuery (git)。
一切都很顺利,直到实际的 grunt 命令输出如下:
grunt --config Gruntfile.js
Running "update_submodules" task
TypeError: Cannot call method 'spawn' of undefined
at Object.<anonymous> (/Users/maciejbodek/Dropbox/Htdocs/git/jquery/node_modules/grunt-update-submodules/tasks/update-submodules.js:7:14)
at Object.task.registerTask.thisTask.fn (/usr/local/lib/node_modules/grunt/lib/grunt/task.js:58:16)
at Task.<anonymous> (/usr/local/lib/node_modules/grunt/lib/util/task.js:343:36)
at Task.start (/usr/local/lib/node_modules/grunt/lib/util/task.js:359:5)
at Object.grunt.tasks (/usr/local/lib/node_modules/grunt/lib/grunt.js:143:8)
at Object.module.exports [as cli] (/usr/local/lib/node_modules/grunt/lib/grunt/cli.js:36:9)
at Object.<anonymous> (/usr/local/lib/node_modules/grunt/bin/grunt:19:14)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
任何提示表示赞赏。安装了所有需要的 npm 依赖等等。只是构建过程最终被中止。
【问题讨论】:
-
看起来您可能使用了错误版本的 grunt。您在全球范围内安装了哪个版本的 grunt?如果它是 grunt 0.3.x,那么您将无法运行该 Gruntfile(它似乎是 grunt-0.4.x Gruntfile.js)。
-
@smithclay 是的,我运行的是 0.3.17。愚蠢的问题 - 我如何更新到最新的开发(0.4.x)?
npm install grunt@0.4似乎有效,但我得到 0.3 作为grunt --version的输出@