New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSHint needs to be installed with gulp-jshint #664

Closed
colin-marshall opened this Issue Dec 30, 2015 · 8 comments

Comments

Projects
None yet
3 participants
@colin-marshall
Copy link
Collaborator

colin-marshall commented Dec 30, 2015

@jimlongo56 @olefredrik:

As of version 2.0, gulp-jshint requires jshint to be installed globally or as a separate dependency in a project. Right now, linting does not work for those who don't have jshint installed globally since jshint was not added to package.json when gulp-jshint was added.

I will take care of this shortly in a PR. I'm also adding gulp-notify to handle error notifications for all tasks, including lint. Now error notifications will be displayed through the user's OS notification system, in addition to the console.

@jimlongo56

This comment has been minimized.

Copy link
Contributor

jimlongo56 commented Dec 30, 2015

I saw that console notice during npm install, yet afterwards I had a folder jshint installed in the project node_modules folder and working. It wasn't installed by me.

@drivenfaroff

This comment has been minimized.

Copy link

drivenfaroff commented Dec 30, 2015

I've got jslint installed globally but still run into this error

npm WARN gulp-jshint@2.0.0 requires a peer of jshint@2.x but none was installed.

@colin-marshall

This comment has been minimized.

Copy link
Collaborator

colin-marshall commented Dec 30, 2015

I just did a test install of FoundationPress and jshint was not installed to node_modules. I'm not sure how the jshint module ended up in your node_modules folder. You can do rm -rf node_modules and npm install and see if it puts it there again.

Here are the steps I took to produce the error:

  • npm uninstall -g jshint (To make sure the global jshint isn't being used instead of the local one)
  • git clone https://github.com/olefredrik/FoundationPress.git
  • cd FoundationPress
  • npm install

Gulp fails and I get this error:
Error: Cannot find module 'jshint/src/cli'

Followed by this warning:
npm WARN EPEERINVALID gulp-jshint@2.0.0 requires a peer of jshint@2.x but none was installed.

The gulp-jshint installation instructions show that we need jshint AND gulp-jshint in our package.json:
npm install jshint gulp-jshint --save-dev

@colin-marshall

This comment has been minimized.

Copy link
Collaborator

colin-marshall commented Dec 30, 2015

@drivenfaroff that is a warning, not an error. Do you only get that warning or do you also get the error I described in my previous post? If you don't receive the error I was getting, then it looks like I was correct that it will fallback to the global jshint module if there isn't one in the project's node_modules directory.

@drivenfaroff

This comment has been minimized.

Copy link

drivenfaroff commented Dec 30, 2015

@colin-marshall I don't get Error: Cannot find module 'jshint/src/cli'

I do however get the following:

npm WARN gulp-jshint@2.0.0 requires a peer of jshint@2.x but none was installed.
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.2.2v
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! foundationpress@2.2.0 postinstall: `bower install && gulp build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the foundationpress@2.2.0 postinstall script 'bower install && gulp build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the foundationpress package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     bower install && gulp build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs foundationpress
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls foundationpress
npm ERR! There is likely additional logging output above.
@colin-marshall

This comment has been minimized.

Copy link
Collaborator

colin-marshall commented Dec 30, 2015

@drivenfaroff I can't tell what is causing your error(s) without seeing what comes directly before the log you posted. To get rid of that warning you can run npm install jshint --save-dev.

@drivenfaroff

This comment has been minimized.

Copy link

drivenfaroff commented Dec 30, 2015

@colin-marshall Log file attached.

Similar issues to #665

npm-debug.txt

@colin-marshall

This comment has been minimized.

Copy link
Collaborator

colin-marshall commented Dec 31, 2015

I'm not sure what the source of your error is. Do you still get it after running npm install jshint --save-dev?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment