Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jshint Error: Cannot find module 'underscore'

Tags:

javascript

npm

My grunt task seems to be running perfectly fine, but every time I run it I'm getting this error:

Loading "jshint.js" tasks...ERROR
>> Error: Cannot find module 'underscore'

Is there any way to find out why this is happening? I can see the /grunt-contrib-jshint directory is in the /node_modules directory. Is there any reason it can't find the underscore module? I've tried running npm install but I still get the same error when I run grunt.

Any ideas? Any help is appreciated.

like image 474
realph Avatar asked Dec 02 '14 14:12

realph


2 Answers

Do the following:

npm update
npm install underscore

If that doesn't work do the following.

rm -rf node_modules
npm install -d
npm update
like image 175
Houdine Avatar answered Sep 19 '22 16:09

Houdine


you can use npm update I test this command and this answer.

like image 30
hjvcghcghchg Avatar answered Sep 21 '22 16:09

hjvcghcghchg