Question

I'm trying to setup Travis CI on one JavaScript project hosted on GitHub but I'm getting error like

Loading "jshint.js" tasks...ERROR

>> Error: Cannot find module 'jshint/src/cli/cli'

Those are my files:

Gruntfile.js

module.exports = function(grunt) {

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    jshint: {
      myFiles: ['cyrlatconverter-v0.5.4.js']
    }
  });

  grunt.loadNpmTasks('grunt-contrib-jshint');
};

.travis.yml

language: node_js
node_js:
  - 0.10

package.json

{
  "name": "node-travis",
  "version": "0.1.0",
  "devDependencies": {
    "grunt": "0.4.1",
    "grunt-cli": "0.1.9",
    "grunt-contrib-jshint": "0.6.0"
  },
  "scripts": {
    "test": "grunt --verbose"
  }
}
Was it helpful?

Solution

Upgrading versions as discussed in github.com/gruntjs/grunt-contrib-jshint/issues/92 solved the problem.

Also as @Dexa pointed out, for him - removal of scripts part of the package.json worked and adding following to the Gruntfile.js :

grunt.registerTask('default', ['jshint']);

For clarification, ^ above registers default grunt task to run jshint when grunt is wrote to command line.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top