maenu / grunt-template-jasmine-istanbul-example

Example application using grunt-istanbul and grunt-contrib-jasmine
MIT License
21 stars 8 forks source link

>> TypeError: Cannot call method 'on' of undefined #2

Closed hlopes closed 11 years ago

hlopes commented 11 years ago

Hi, After clone this repo in a local folder i run the recommended commands, but when i try to execute "grunt coverage" the following error is displayed:

$ grunt coverage
Loading "grunt.js" tasks and helpers...ERROR
>> TypeError: Cannot call method 'on' of undefined

Running "instrument" task
OK

Running "jasmine:coverage" (jasmine) task

e:\cvspresent\users\hlopes\projects\JS Coverage\Instanbul project\example-grunt-jasmine-istanbul\node_modules\grunt-istanbul\node_modules\nue\lib\nue.js:82
          throw e;
                ^
TypeError: Object #<Object> has no method 'options'
    at Object.module.exports.file (e:\cvspresent\users\hlopes\projects\JS Coverage\Instanbul project\example-grunt-jasmine-istanbul\node_modules\grunt-contrib-jasmine\tasks\jasmine.js:36:24)
    at Object.task.registerMultiTask.thisTask (e:\cvspresent\users\hlopes\projects\JS Coverage\Instanbul project\example-grunt-jasmine-istanbul\node_modules\grunt\lib\grunt\task.js:109:15)
    at Object.task.registerTask.thisTask.fn (e:\cvspresent\users\hlopes\projects\JS Coverage\Instanbul project\example-grunt-jasmine-istanbul\node_modules\grunt\lib\grunt\task.js:58:16)
    at Task.<anonymous> (e:\cvspresent\users\hlopes\projects\JS Coverage\Instanbul project\example-grunt-jasmine-istanbul\node_modules\grunt\lib\util\task.js:343:36)
    at Task.<anonymous> (e:\cvspresent\users\hlopes\projects\JS Coverage\Instanbul project\example-grunt-jasmine-istanbul\node_modules\grunt\lib\util\task.js:319:9)
    at runStep (e:\cvspresent\users\hlopes\projects\JS Coverage\Instanbul project\example-grunt-jasmine-istanbul\node_modules\grunt-istanbul\node_modules\nue\lib\nue.js:113:14)
    at lastStep (e:\cvspresent\users\hlopes\projects\JS Coverage\Instanbul project\example-grunt-jasmine-istanbul\node_modules\grunt-istanbul\node_modules\nue\lib\nue.js:79:11)
    at StepContext.next (e:\cvspresent\users\hlopes\projects\JS Coverage\Instanbul project\example-grunt-jasmine-istanbul\node_modules\grunt-istanbul\node_modules\nue\lib\nue.js:230:14)
    at StepContext.asyncCallback (e:\cvspresent\users\hlopes\projects\JS Coverage\Instanbul project\example-grunt-jasmine-istanbul\node_modules\grunt-istanbul\node_modules\nue\lib\nue.js:352:21)
    at asyncCallback (e:\cvspresent\users\hlopes\projects\JS Coverage\Instanbul project\example-grunt-jasmine-istanbul\node_modules\grunt-istanbul\node_modules\nue\lib\nue.js:352:21)

First i think that was a package dependency missing somewhere so i have forced the installation of grunt-contrib-jasmine and grunt-istanbul.

However this attempt was unsuccessful. Can you give some hint of whats is causing this error?

Thks, Hugo Lopes

maenu commented 11 years ago

I can not reproduce the error. When I clone, npm install and grunt coverage it works just fine. I guess this is somehow related to grunt. Are you sure you are using grunt 0.4? Maybe your grunt command still points to the 0.3 binary. See grunt upgrading guide to check if your grunt setup is fine.

hlopes commented 11 years ago

Thanks, that was the problem. After updating the grunt to 0.4.0rc5 the example worked as expected. Once again thanks.