Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

JSHint needs to be installed with gulp-jshint #664

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

JSHint needs to be installed with gulp-jshint #664

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

Comments

@colin-marshall
Copy link
Collaborator

@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
Copy link
Contributor

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.

@brycejacobson
Copy link

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

npm WARN [email protected] requires a peer of [email protected] but none was installed.

@colin-marshall
Copy link
Collaborator Author

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 [email protected] requires a peer of [email protected] 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
Copy link
Collaborator Author

@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.

@brycejacobson
Copy link

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

I do however get the following:

npm WARN [email protected] requires a peer of [email protected] 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! [email protected] postinstall: `bower install && gulp build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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
Copy link
Collaborator Author

@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.

@brycejacobson
Copy link

@colin-marshall Log file attached.

Similar issues to #665

npm-debug.txt

@colin-marshall
Copy link
Collaborator Author

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants