module.js:340 throw err; ^ Error: Cannot find module / node.js error

Sometimes when you work with node.js apps (grunt, yeoman, gulp etc) you will see something like this error log:

module.js:340
    throw err;
          ^
Error: Cannot find module '<name of dependency>'

All you need to do is remember <name of dependency> and write:

npm install <name of dependency>

If you want to save dependancy in your package.json:

npm install <name of dependency> --save-dev