I\'m trying to setup a development environment with Yeoman for AngularJS,
I installed Yeoman according to the instructions: sudo npm install -g yo bower grunt-cli generato
npm install grunt-karma --save-dev
or if you need it
sudo npm install grunt-karma --save-dev
from the docs on https://npmjs.org/package/grunt-karma
after running
npm install grunt-karma --save-dev
add the following line to Gruntfile.js
grunt.loadNpmTasks('grunt-karma');
this works for me.
The obvious answers already posted here were completely unhelpful to me. If reinstalling grunt-karma via npm didn't work, and explicitly loading the task in the Gruntfile didn't help, you may be running a version of npm prior to 1.2.10.
It turns out that recent versions of grunt-karma rely on peer dependencies, which were introduced to Node with version 8.19. After upgrading Nodejs (which also installs npm) and upgrading karma globally, I discovered I needed to edit my karma config files as well. You'll want to add frameworks: ['jasmine'],
to karma.conf.js
and remove references to JASMINE
and JASMINE_ADAPTER
from the files
setting.
A was having the problem of Not Found.
Finally I realize it was a problem with the port (8080 was already used)
in karma.config.js change the port number:
// web server port
port: 9999,