Recently I've wanted to start using Grunt in order to improve my development workflow. Although I've had some trouble while Grunt up and running. After creating a package.json file and a Grunt file.js I've tried running a simple test with grunt-karma with no luck.
All I receive is the error
Loading "grunt-karma.js" tasks...ERROR
RangeError: Maximum call stack size exceeded
I am running node version 10.12 with grunt-cli & grunt versions 0.1.9 and 0.4.1 respectively.
Below is my package file with all of my dev dependancies and my grunt file.
package.json
{
"name": "crudangular",
"version": "0.0.1",
"devDependencies": {
"grunt": "~0.4.1",
"karma": "~0.8.6",
"grunt-karma": "~0.4.4",
"phantomjs": "~1.9.1-0"
}
}
Gruntfile.js
module.exports = function(grunt){
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
karma: {
unit:{
configFile: 'karma.conf.js'
}
}
});
grunt.loadNpmTasks('grunt-karma');
grunt.registerTask('default',['karma']);
}
Any help would be greatly appreciated. Thanks in advance.
Someone else had this issue and ask about this on IRC. Reinstalling node.js and npm helped them resolve this issue.
Also make sure you clear npm cache.
You can also try to get npm install grunt-karma into a temporary directory, then npm install in that directory and run the tests using grunt test. This way you can make sure it's an issue with the plugin.
If running the rests fails, please file an issue on the plugin page, state your OS and node version.
Plugin page: https://github.com/karma-runner/grunt-karma