2013-01-10 21 views
2

我没有运用grunt构建jQuery(git)。无法使用grunt构建jquery - 子模块错误

一切顺利直到实际咕噜命令,其输出如下:

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依赖项等。这只是最终被中止的构建过程。

+0

看起来你可能会使用咕噜的版本错误。你在全球安装了什么版本的grunt?如果它是咕噜0.3.x,那么你将无法运行Gruntfile(它似乎是grunt-0.4.x Gruntfile.js)。 – smithclay

+0

@smithclay是的,我运行0.3.17。愚蠢的问题 - 我如何更新到最新的devel(0.4.x)? 'npm install grunt @ 0.4'似乎可以工作,但是我得到0.3作为'grunt --version'的输出。 – ienes

回答

3

你需要运行咕噜的最新开发人员版,您可以与npm install [email protected]

得到另外,还要确保你已经卸载旧的全局咕噜npm uninstall -g grunt和安装咕噜-CLI全球npm install -g grunt-cli

Upgrading from 0.3 to 0.4

+1

这对构建jQuery 1.9.0b1并不适用,我试图这样做。至少,jQuery 1.9.0b1具有grunt.js文件而不是Gruntfile.js文件,因此显然设计为使用grunt v0.3而不是0.4。 FWIW,我无法用grunt 0.4构建jQuery 2.0.0b1,但这是一个单独的问题。 –

相关问题