Skip to content

Error: Cannot find module 'jshint/src/cli' on fresh install. #1731

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

Closed
collinmesser opened this issue Mar 21, 2016 · 4 comments
Closed

Error: Cannot find module 'jshint/src/cli' on fresh install. #1731

collinmesser opened this issue Mar 21, 2016 · 4 comments

Comments

@collinmesser
Copy link

A clean install throws this error when I try to run "Gulp Serve". It appears to me that jshint is installed though and I have it installed globally.


collinmesser at Collins-MacBook-Air in ~/code/apps/jsapps/mean/test2
$ gulp serve
[14:02:08] Requiring external module babel-register
module.js:340
    throw err;
    ^

Error: Cannot find module 'jshint/src/cli'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:289:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/Users/collinmesser/Code/Apps/jsapps/MEAN/test2/node_modules/gulp-jshint/src/extract.js:1:79)
    at Module._compile (module.js:425:26)
    at Module._extensions..js (module.js:432:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/collinmesser/Code/Apps/jsapps/MEAN/test2/node_modules/babel-register/lib/node.js:134:7)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/Users/collinmesser/Code/Apps/jsapps/MEAN/test2/node_modules/gulp-jshint/src/index.js:2:15)
    at Module._compile (module.js:425:26)
    at Module._extensions..js (module.js:432:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/collinmesser/Code/Apps/jsapps/MEAN/test2/node_modules/babel-register/lib/node.js:134:7)

@dynamicmonkeys
Copy link

Are you sure the jshint bin is installed though or just gulp-jshint?

What does:
jshint --version
give you?

I had a clean c9 container tonight, installed but came across the same problem:
npm install -g --save-dev jshint
fixed it for me

jshint --version
jshint v2.9.1

@collinmesser
Copy link
Author

If I run:
jshint --version
I get jshint v2.9.1 both globally and in the project repo.

What worked for me was downgrading the local jshint to version 2.8.0 following the advice here spalger/gulp-jshint#131.
npm install --save-dev [email protected]

Apparently jshint is a peer dependency of gulp-jshint and for some reason the most recent version doesn't seem to register correctly.

@aendra-rininsland
Copy link

This still occurs as of 12 April 2016. I resolved it locally by reinstalling gulp-jshint and jshint:

Seems like package.json might need an update...

npm install --save-dev jshint gulp-jshint

@panique
Copy link

panique commented Apr 14, 2016

+1, same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants