0

I have the following JShint related modules versions on my local machine and our jenkins build machine, which runs jshint before building the UI:

npm -v                                // 2.14.7
npm view jshint version               // 2.9.2
npm view grunt version                // 1.0.1
npm view grunt-contrib version        // 0.11.0
npm view grunt-contrib-jshint version // 1.0.0

Both machines use the same .jshintrc config file.

When i run jshint on locally i get no problems.
When i run it on the build machine (same code of course) - i get many errors.

I'm pretty sure it's versions related since the config and code are the same but i don't know where else to look.

Thanks!

Daniel
  • 6,194
  • 7
  • 33
  • 59
  • Double check `jshinrc` option in `grunt-contrib-jshint` task configuration. – alexmac Apr 27 '16 at 10:34
  • It's the same configuration (same files) – Daniel Apr 27 '16 at 10:51
  • `jshintrc` option, If set to true, no config will be sent to JSHint and JSHint will search for .jshintrc files relative to the files being linted. – alexmac Apr 27 '16 at 10:53
  • `jshintrc` option is set to the location of the `.jshintrc` file, which is the same on both machines. I've confirmed it uses the right config. – Daniel Apr 27 '16 at 10:56

1 Answers1

0

As it turns out, i was using the wrong command to check my installed packages versions:

npm view <package_name> version; // returns the latest available version of the package.

The command i needed to use was:

npm list <package_name>; // returns the installed package (and it's dependencies) version

After using the right command i saw that

local: npm list grunt-contrib-jshint; // 0.11.0 depends on JShint ~2.6.0
jenkins: npm list grunt-contrib-jshint; // 1.0.0 depends on JShint ~2.9.1

And was getting errors on jenkins machine since JShint ~2.9.1 is much stricter than JShint ~2.6.0.

Daniel
  • 6,194
  • 7
  • 33
  • 59