Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find module 'karma' while using grunt

I am using Yeoman toolkit to bootstrap an Angular web application. I've followed all the steps mentioned here. But still, apparently, grunt can not find the karma module. It spits out this error:

Loading "grunt-karma.js" tasks...ERROR >> Error: Cannot find module 'karma' Warning: Task "karma" not found. Use --force to continue.  Aborted due to warnings. 

I've tried installing karma both locally and globally using npm, but nothing seems to work.

like image 746
TeknasVaruas Avatar asked Oct 05 '13 21:10

TeknasVaruas


2 Answers

Make sure you have installed both karma and grunt-karma before running the grunt task:

npm install karma npm install grunt-karma 

EDIT: One liner:

npm install karma grunt-karma 
like image 51
Stuart Avatar answered Sep 19 '22 04:09

Stuart


I had to install the following

  npm install phantomjs   npm install jasmine-core   npm install karma   npm install grunt-karma 

Goodluck, Rajesh

Edit: One liner:

npm install karma grunt-karma jasmine-core phantomjs 
like image 31
Rajesh Jain Avatar answered Sep 18 '22 04:09

Rajesh Jain