Jshint Error: cannot find module 'underscore'

My grunt task works fine, but every time I run it, I get this error:

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

Is there any way to find out why this is happening? I see that the /grunt-contrib-jshint is in the /node_modules . Is there a reason why it cannot find the underscore module? I tried to run npm install , but I still get the same error when I run grunt.

Any ideas? Any help is appreciated.

+5
source share
2 answers

When you have cannot find module x errors , it is sometimes useful to delete the entire npm_modules folder and run npm install again.

Sometimes, in the initial npm install , it may not get one dependency for a package, and it will not try to get it again when you run npm install again, because it received all the packages you need, maybe not all the dependencies of these packages.

+17
source

you can use npm update I am checking this command and this answer.

+4
source

Source: https://habr.com/ru/post/1208153/


All Articles