Unable to find local grunt

gruntjs, javascript

Solution

Have you installed grunt in your Jenkins server?

npm install grunt

Problem

I have grunt running this just fine locally, however after setting up my Jenkins server to do the same thing I'm running into a problem with grunt being unable to find the grunt file. Could I have missed installing/configuring something? I can't tell what's wrong from the error output, here is what i'm getting on the jenkins box: [user@buildserver]# ls ``` AUTHORS CHANGELOG coverage Gruntfile.js package.json README.md reports spec src ``` [user@buildserver]# grunt ``` grunt-cli: The grunt command line interface. (v0.1.6) Fatal error: Unable to find local grunt. If you're seeing this message, either a Gruntfile wasn't found or grunt hasn't been installed locally to your project. For more information about installing and configuring grunt, please see the Getting Started guide: http://gruntjs.com/getting-started ``` Here's the Gruntfile.js ``` module.exports = function(grunt) { 'use strict'; // Project configuration. grunt.initConfig({ jasmine : { src : 'src/**/*.js', options : { specs : 'spec/**/*.js', template : require('grunt-template-jasmine-istanbul'), templateOptions: { coverage: 'reports/coverage.json', report: 'reports/coverage' } } }, }); grunt.loadNpmTasks('grunt-contrib-jasmine'); grunt.registerTask('default', ['jasmine']); }; ```

Original source