Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

So I've got a fresh install of El Capitan and I'm giving these task runners another go.

I'm following sitepoint's An introduction to Gulp.js, but I'm stuck on step four, when I try to run gulp jshint I get "Error: Cannot find module 'jshint/src/cli'"

I've no idea what's causing this, which is why I'm asking here. Below are a couple of screen grabs to help with the issue.

Terminal error when running gulp jshint

Folder structer for gulp project

As always, I'm eternally grateful for any advice.

like image 557
lateralaus Avatar asked Oct 08 '22 02:10

lateralaus


2 Answers

You need to install jshint as well, that will sort out the issue.

> npm install --save-dev jshint gulp-jshint
like image 330
fmatar Avatar answered Oct 20 '22 19:10

fmatar


It turns out I need to use npm install --save-dev jshint gulp-jshint instead of npm install gulp-jshint --save-dev as the tutorial stated. Discussion around this was found at https://github.com/spalger/gulp-jshint/issues/131 with massive thanks to @user3042437 for suppling the link.

like image 27
lateralaus Avatar answered Oct 20 '22 20:10

lateralaus